home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Graphics / QuickDraw GX / GX->PostScript Sample / GXToPostScript / PostScriptFiles / PSProcSet.r < prev    next >
Encoding:
Text File  |  2000-09-28  |  60.6 KB  |  2,891 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        PSProcSet.r
  3.  
  4.      Contains:    QuickDraw GX to PostScript conversion code.
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1.x
  7.       
  8.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #include <Types.r>
  12. #include <DatabaseAccess.r>
  13.  
  14. #include "PSProcSetIDs.h"
  15.  
  16. resource 'wstr' (kStartProcId, sysHeap, purgeable) {
  17.     "currentfont /setfont load stopped not dup \n"
  18.     "/dontDefineDummyFont exch def    {save} {pop} ifelse \n"
  19.     "10 dict dup begin\n"
  20.     "/FontType 3 def\n"
  21.     "/FontMatrix [1 0 0 1 0 0] def\n"
  22.     "/FontBBox [0 0 0 0] def\n"
  23.     "/Encoding StandardEncoding def\n"
  24.     "/BuildChar {} def\n"
  25.     "/FontName /dummyFont def\n"
  26.     "end\n"
  27.     "/dummyFont exch definefont setfont \n"
  28.     "dontDefineDummyFont {restore} if \n"
  29.     "/maxfloat 32768.0 def \n"
  30.     "/minfloat maxfloat neg def\n"
  31.     "/T true def\n"
  32.     "/F false def\n"
  33.     "/@1 0 def\n"
  34.     "/@2 0 def\n"
  35.     "/@3 0 def\n"
  36.     "/@4 0 def\n"
  37.     "/@5 0 def\n"
  38.     "/@6 0 def\n"
  39.     "/@7 0 def\n"
  40.     "/@8 0 def\n"
  41.     "/aChar 1 string def \n"
  42.     "/ScratchMatrix [0 0 0 0 0 0] def \n"
  43.     "/CurrCTM matrix currentmatrix    def \n"
  44.     "/Bdef {bind def} bind def\n"
  45.     "/Xdef {exch def} Bdef\n"
  46.     "/Xstore {exch store} Bdef\n"
  47.     "/Inc {dup load 1 add store} Bdef\n"
  48.     "/Dec {dup load 1 sub store} Bdef\n"
  49.     "/ExecLimChk {\n"
  50.     "errordict /limitcheck get exec\n"
  51.     "} Bdef\n"
  52.     "/CharPathCount 0 def\n"
  53.     "/GXCharPath {\n"
  54.     "/CharPathCount Inc\n"
  55.     "userdict begin \n"
  56.     "/charpath load exec \n"
  57.     "end\n"
  58.     "/CharPathCount Dec\n"
  59.     "} Bdef\n"
  60.     "/CopyDict {\n"
  61.     "{\n"
  62.     "2 index \n"
  63.     "3 1 roll \n"
  64.     "put\n"
  65.     "} forall\n"
  66.     "pop \n"
  67.     "} Bdef\n"
  68.     "/BoxWidths {\n"
  69.     "exch \n"
  70.     "4 -1 roll \n"
  71.     "sub \n"
  72.     "3 1 roll \n"
  73.     "exch sub \n"
  74.     "} Bdef\n"
  75.     "/FullPath {\n"
  76.     "minfloat minfloat moveto\n"
  77.     "maxfloat minfloat lineto\n"
  78.     "maxfloat maxfloat lineto\n"
  79.     "minfloat maxfloat lineto\n"
  80.     "closepath\n"
  81.     "} Bdef\n"
  82.     "/EmptyPath {\n"
  83.     "0 0 moveto \n"
  84.     "} Bdef\n"
  85.     "/TightFullPath {\n"
  86.     "gsave \n"
  87.     "clippath \n"
  88.     "pathbbox\n"
  89.     "grestore\n"
  90.     "4 copy \n"
  91.     "BoxWidths \n"
  92.     "4 2 roll \n"
  93.     "pop pop \n"
  94.     "RP \n"
  95.     "} Bdef\n"
  96.     "/PointsAvailable {\n"
  97.     "gsave\n"
  98.     "newpath\n"
  99.     "0.0 0.0 /moveto    load stopped not \n"
  100.     "{ \n"
  101.     "1 \n"
  102.     "{    \n"
  103.     "1.0 1.0 /lineto load stopped \n"
  104.     "{pop pop exit} \n"
  105.     "{1 add    } ifelse \n"
  106.     "} loop\n"
  107.     "}\n"
  108.     "{pop pop 0} \n"
  109.     "ifelse\n"
  110.     "grestore\n"
  111.     "} Bdef\n"
  112.     "/AvoidLimit {\n"
  113.     "/@1 exch store \n"
  114.     "/@2 exch store \n"
  115.     "currentflat dup /@3 exch store    \n"
  116.     "{\n"
  117.     "gsave\n"
  118.     "@2 load stopped not \n"
  119.     "{ \n"
  120.     "@1 0 gt { \n"
  121.     "PointsAvailable @1 ge\n"
  122.     "{exit} if \n"
  123.     "} {exit} ifelse \n"
  124.     "} if\n"
  125.     "grestore \n"
  126.     "/@3 @3 2 mul dup setflat store \n"
  127.     "@3 1000 gt {exit} if \n"
  128.     "} loop\n"
  129.     "@3 1000 lt { \n"
  130.     "grestore \n"
  131.     "@3 setflat \n"
  132.     "@2 load exec \n"
  133.     "} { \n"
  134.     "pop \n"
  135.     "@2 ExecLimChk \n"
  136.     "} ifelse\n"
  137.     "setflat \n"
  138.     "} Bdef\n"
  139.     "languagelevel 2 lt {\n"
  140.     "/SF {\n"
  141.     "exch findfont \n"
  142.     "exch dup type /arraytype eq { \n"
  143.     "dup \n"
  144.     "AugGstate /FontMapping get \n"
  145.     "copy pop\n"
  146.     "makefont \n"
  147.     "}    { \n"
  148.     "dup \n"
  149.     "0 0    2 index 0 0 \n"
  150.     "AugGstate /FontMapping get\n"
  151.     "astore pop\n"
  152.     "scalefont \n"
  153.     "} ifelse\n"
  154.     "setfont \n"
  155.     "} Bdef\n"
  156.     "} { \n"
  157.     "/SF {\n"
  158.     "dup type /arraytype eq { \n"
  159.     "dup \n"
  160.     "AugGstate /FontMapping get \n"
  161.     "copy pop\n"
  162.     "}    { \n"
  163.     "dup \n"
  164.     "0 0    2 index 0 0 \n"
  165.     "AugGstate /FontMapping get\n"
  166.     "astore pop\n"
  167.     "} ifelse\n"
  168.     "selectfont \n"
  169.     "} Bdef\n"
  170.     "} ifelse\n"
  171.     "/SFy {\n"
  172.     "0 0 2 index neg 0 0 \n"
  173.     "ScratchMatrix astore \n"
  174.     "1 index type /dicttype eq { \n"
  175.     "makefont setfont \n"
  176.     "} { \n"
  177.     "SF \n"
  178.     "} ifelse\n"
  179.     "} Bdef\n"
  180.     "/SFt {\n"
  181.     "0 0 \n"
  182.     "ScratchMatrix astore \n"
  183.     "makefont setfont \n"
  184.     "} Bdef\n"
  185.     "/RP {\n"
  186.     "4 2 roll \n"
  187.     "moveto \n"
  188.     "exch dup 0 rlineto \n"
  189.     "exch 0 exch rlineto \n"
  190.     "neg 0 rlineto \n"
  191.     "closepath \n"
  192.     "} Bdef\n"
  193.     "/Pnt {\n"
  194.     "moveto \n"
  195.     "1 0 idtransform \n"
  196.     "rlineto \n"
  197.     "} Bdef\n"
  198.     "languagelevel 2 lt {\n"
  199.     "/RF {\n"
  200.     "gsave newpath \n"
  201.     "RP    \n"
  202.     "fill grestore\n"
  203.     "} Bdef\n"
  204.     "/RStr {\n"
  205.     "gsave newpath \n"
  206.     "RP    \n"
  207.     "stroke grestore\n"
  208.     "} Bdef\n"
  209.     "/RCl {\n"
  210.     "newpath\n"
  211.     "RP    \n"
  212.     "clip\n"
  213.     "newpath\n"
  214.     "} Bdef\n"
  215.     "} { \n"
  216.     "/RF /rectfill load def\n"
  217.     "/RStr /rectstroke load def\n"
  218.     "/RCl /rectclip load def\n"
  219.     "} ifelse\n"
  220.     "/ATanRot {\n"
  221.     "2 copy \n"
  222.     "dup mul exch\n"
  223.     "dup mul add\n"
  224.     "sqrt\n"
  225.     "dup 3 1 roll \n"
  226.     "div \n"
  227.     "3 1 roll\n"
  228.     "div \n"
  229.     "dup \n"
  230.     "neg \n"
  231.     "2 index \n"
  232.     "0. 0.\n"
  233.     "ScratchMatrix astore concat\n"
  234.     "} Bdef\n"
  235.     "/MakeShapeDict {\n"
  236.     "dup dup /i eq exch /b eq or { \n"
  237.     "12 dict begin \n"
  238.     "} {\n"
  239.     "9 dict begin \n"
  240.     "} ifelse\n"
  241.     "/shapeType Xdef\n"
  242.     "/y2 Xdef\n"
  243.     "/x2 Xdef\n"
  244.     "/y1 Xdef\n"
  245.     "/x1 Xdef\n"
  246.     "/fillKey Xdef\n"
  247.     "/geomProc Xdef\n"
  248.     "shapeType dup /b eq exch /i eq or {\n"
  249.     "/BitsPerPixel Xdef\n"
  250.     "/BitmapStrings Xdef\n"
  251.     "/colorSet null def \n"
  252.     "/ColorSpace null def\n"
  253.     "dup null ne { \n"
  254.     "dup /CSA known { \n"
  255.     "/ColorSpace Xdef \n"
  256.     "} { \n"
  257.     "/colorSet Xdef \n"
  258.     "}ifelse \n"
  259.     "} { \n"
  260.     "pop \n"
  261.     "} ifelse\n"
  262.     "/HaveDrawnIt false def \n"
  263.     "} { \n"
  264.     "/ColorSpace null def\n"
  265.     "/colorSet null def\n"
  266.     "} ifelse\n"
  267.     "currentdict end \n"
  268.     "} Bdef\n"
  269.     "/ShapeBBox {\n"
  270.     "dup /x1 get exch\n"
  271.     "dup /y1 get exch\n"
  272.     "dup /x2 get exch\n"
  273.     "/y2 get\n"
  274.     "} Bdef\n"
  275.     "/Max {\n"
  276.     "2 copy\n"
  277.     "gt {pop} {exch pop} ifelse\n"
  278.     "} Bdef\n"
  279.     "/Min {\n"
  280.     "2 copy\n"
  281.     "lt {pop} {exch pop} ifelse\n"
  282.     "} Bdef\n"
  283.     "/Grid {\n"
  284.     "transform \n"
  285.     "round exch round exch \n"
  286.     "itransform \n"
  287.     "} Bdef\n"
  288.     "/PtNx {\n"
  289.     "3 copy put \n"
  290.     "pop \n"
  291.     "1 add \n"
  292.     "} Bdef\n"
  293.     "/NotEqual {\n"
  294.     "sub abs 0.001 ge \n"
  295.     "} Bdef\n"
  296.     "/GXSetRGBColor /setrgbcolor load def\n"
  297.     "/colorimage where {pop /GXColorImage /colorimage load def} if\n"
  298. };
  299. resource 'wstr' (kStartProcId+1, sysHeap, purgeable) {
  300.     "/NewAugGstate {\n"
  301.     "11 dict dup begin\n"
  302.     "/xBold 0 def\n"
  303.     "/yBold 0 def\n"
  304.     "/dash null def\n"
  305.     "/rightIsOut false def\n"
  306.     "/frameType 0 def\n"
  307.     "/FontMapping    [1 0 0 1 0 0] def \n"
  308.     "/ColorSet null def \n"
  309.     "/orMode 0 def \n"
  310.     "/baseFont null def \n"
  311.     "/pattern null def \n"
  312.     "/gridFit false def\n"
  313.     "end\n"
  314.     "} Bdef\n"
  315.     "/AugGstate NewAugGstate def \n"
  316.     "/AugGsaveStack 31 array def \n"
  317.     "0 1 30 {AugGsaveStack exch NewAugGstate put} for\n"
  318.     "/AugGsaveSP 0 def \n"
  319.     "/AugGsave {\n"
  320.     "AugGsaveStack AugGsaveSP get \n"
  321.     "AugGstate\n"
  322.     "CopyDict\n"
  323.     "/AugGsaveSP Inc \n"
  324.     "} Bdef\n"
  325.     "/AugGrestore {\n"
  326.     "/AugGsaveSP Dec\n"
  327.     "AugGsaveSP 0 lt {/AugGsave 0 store} if\n"
  328.     "AugGstate\n"
  329.     "AugGsaveStack AugGsaveSP get\n"
  330.     "CopyDict \n"
  331.     "} Bdef\n"
  332.     "/FullGsave {gsave AugGsave} Bdef\n"
  333.     "/FullGrestore {AugGrestore currentfont grestore setfont} Bdef\n"
  334.     "/QD2Grestore {\n"
  335.     "currentlinewidth\n"
  336.     "currentlinecap\n"
  337.     "currentlinejoin\n"
  338.     "currentmiterlimit\n"
  339.     "CurrGridFit\n"
  340.     "currentfont\n"
  341.     "currentdash\n"
  342.     "grestore\n"
  343.     "CurrPat null ne {\n"
  344.     "SynchPatMatrix\n"
  345.     "} if\n"
  346.     "setdash    \n"
  347.     "setfont\n"
  348.     "SetGridFit\n"
  349.     "setmiterlimit\n"
  350.     "setlinejoin\n"
  351.     "setlinecap\n"
  352.     "setlinewidth\n"
  353.     "} Bdef\n"
  354.     "/SetColorSet {\n"
  355.     "AugGstate /ColorSet 3 -1 roll put\n"
  356.     "} Bdef\n"
  357.     "/CurrColorSet {\n"
  358.     "AugGstate /ColorSet get\n"
  359.     "} Bdef\n"
  360.     "/SetBold {\n"
  361.     "AugGstate /yBold 3 -1 roll put\n"
  362.     "AugGstate /xBold 3 -1 roll put\n"
  363.     "} Bdef\n"
  364.     "/CurrBold {\n"
  365.     "AugGstate /xBold get\n"
  366.     "AugGstate /yBold get\n"
  367.     "} Bdef\n"
  368.     "/HasBold {\n"
  369.     "CurrBold \n"
  370.     "0 ne \n"
  371.     "exch 0 ne \n"
  372.     "or \n"
  373.     "} Bdef\n"
  374.     "languagelevel 2 lt {\n"
  375.     "/SetGridFit {\n"
  376.     "AugGstate /gridFit 3 -1 roll put\n"
  377.     "} Bdef\n"
  378.     "/CurrGridFit {\n"
  379.     "AugGstate /gridFit get\n"
  380.     "} Bdef\n"
  381.     "} {\n"
  382.     "/SetGridFit /setstrokeadjust load def\n"
  383.     "/CurrGridFit /currentstrokeadjust load def\n"
  384.     "} ifelse\n"
  385.     "/SetPat {\n"
  386.     "AugGstate /pattern 3 -1 roll put\n"
  387.     "} Bdef\n"
  388.     "/CurrPat { \n"
  389.     "AugGstate /pattern get\n"
  390.     "} Bdef\n"
  391.     "/SetDash {\n"
  392.     "dup null eq { \n"
  393.     "[] 0 setdash \n"
  394.     "} { \n"
  395.     "dup type /dicttype ne { \n"
  396.     "setdash \n"
  397.     "null \n"
  398.     "} { \n"
  399.     "[] 0 setdash \n"
  400.     "} ifelse\n"
  401.     "} ifelse\n"
  402.     "AugGstate /dash 3 -1 roll put \n"
  403.     "} Bdef\n"
  404.     "/CurrDash {\n"
  405.     "AugGstate /dash get\n"
  406.     "} Bdef\n"
  407.     "/SetFrame {\n"
  408.     "AugGstate /frameType 3 -1 roll put\n"
  409.     "} Bdef\n"
  410.     "/CurrFrame {\n"
  411.     "AugGstate /frameType get\n"
  412.     "} Bdef\n"
  413.     "/SetRightIsOut {\n"
  414.     "AugGstate /rightIsOut 3 -1 roll put\n"
  415.     "} Bdef\n"
  416.     "/CurrRightIsOut {\n"
  417.     "AugGstate /rightIsOut get\n"
  418.     "} Bdef\n"
  419.     "/SetOrMode {\n"
  420.     "AugGstate /orMode 3 -1 roll put\n"
  421.     "} Bdef\n"
  422.     "/CurrOrMode {\n"
  423.     "AugGstate /orMode get\n"
  424.     "} Bdef\n"
  425.     "/ImageMaskSenseArray [true true true false false] def\n"
  426.     "/ImageMaskSense {\n"
  427.     "ImageMaskSenseArray CurrOrMode get\n"
  428.     "} Bdef\n"
  429.     "/ImageMaskColorArray [1 1 0 1 0] def\n"
  430.     "/ImageMaskColor {\n"
  431.     "ImageMaskColorArray CurrOrMode get\n"
  432.     "} Bdef\n"
  433.     "/SetBaseFont {\n"
  434.     "AugGstate /baseFont 3 -1 roll put\n"
  435.     "} Bdef\n"
  436.     "/CurrBaseFont {\n"
  437.     "AugGstate /baseFont get\n"
  438.     "} Bdef\n"
  439.     "/MakeStyleDict {\n"
  440.     "10 dict dup begin \n"
  441.     "11 1 roll \n"
  442.     "/textSize Xdef\n"
  443.     "/gridFit Xdef\n"
  444.     "/mitre Xdef\n"
  445.     "/join Xdef\n"
  446.     "/cap Xdef\n"
  447.     "/pen Xdef\n"
  448.     "/dash Xdef\n"
  449.     "/frameType Xdef\n"
  450.     "/rightIsOut Xdef\n"
  451.     "/pattern Xdef\n"
  452.     "end\n"
  453.     "} Bdef\n"
  454.     "/nilStyleDict 10 dict dup\n"
  455.     "begin\n"
  456.     "/textSize 1 def\n"
  457.     "/gridFit false def\n"
  458.     "/mitre 1000 def\n"
  459.     "/join 0 def\n"
  460.     "/cap 0 def\n"
  461.     "/pen 0 def\n"
  462.     "/dash null def\n"
  463.     "/frameType 0 def\n"
  464.     "/rightIsOut F def\n"
  465.     "/pattern null def\n"
  466.     "end\n"
  467.     "def\n"
  468.     "/SetStyle {\n"
  469.     "dup /dash get SetDash\n"
  470.     "dup /pattern get SetPat\n"
  471.     "dup /rightIsOut get SetRightIsOut\n"
  472.     "dup /pen get setlinewidth\n"
  473.     "dup /cap get setlinecap\n"
  474.     "dup /join get setlinejoin\n"
  475.     "dup /mitre get setmiterlimit\n"
  476.     "dup /frameType get SetFrame\n"
  477.     "/gridFit get SetGridFit\n"
  478.     "} Bdef\n"
  479.     "languagelevel 1 gt {\n"
  480.     "/SynchPatMatrix {\n"
  481.     "CurrPat null ne { \n"
  482.     "CurrPat dup \n"
  483.     "/patTransform get makepattern \n"
  484.     "SetPat \n"
  485.     "} if\n"
  486.     "} Bdef\n"
  487.     "} { \n"
  488.     "/SynchPatMatrix {\n"
  489.     "CurrPat null ne {\n"
  490.     "CurrPat begin\n"
  491.     "/patTransform [ \n"
  492.     "ux uy Grid\n"
  493.     "vx vy Grid\n"
  494.     "px py Grid\n"
  495.     "] def\n"
  496.     "/IpatTransform patTransform IpatTransform invertmatrix def\n"
  497.     "patternFontDict /AdvanceVector get patTransform 0 get 0 exch put\n"
  498.     "patternFontDict /AdvanceVector get patTransform 1 get 1 exch put\n"
  499.     "end\n"
  500.     "} if\n"
  501.     "} def\n"
  502.     "} ifelse \n"
  503. };
  504. resource 'wstr' (kStartProcId+2, sysHeap, purgeable) {
  505.     "languagelevel 2 lt {\n"
  506.     "/ShapeBuildChar {\n"
  507.     "pop \n"
  508.     "begin \n"
  509.     "0 setlinewidth \n"
  510.     "Shape begin \n"
  511.     "AdvanceVector dup 0 get exch 1 get \n"
  512.     "shapeType /i ne { \n"
  513.     "x1 y1 Grid x2 y2 Grid setcachedevice    \n"
  514.     "geomProc \n"
  515.     "FillDict fillKey get exec \n"
  516.     "} { \n"
  517.     "setcharwidth \n"
  518.     "geomProc \n"
  519.     "} ifelse\n"
  520.     "end\n"
  521.     "end\n"
  522.     "} Bdef\n"
  523.     "} {\n"
  524.     "/PatternPaintProc {\n"
  525.     "begin \n"
  526.     "IpatTransform concat \n"
  527.     "patShape begin \n"
  528.     "CurrColorSet \n"
  529.     "colorSet SetColorSet \n"
  530.     "ColorSpace null ne { \n"
  531.     "ColorSpace GXSetCSpace \n"
  532.     "} if\n"
  533.     "shapeType /b eq { \n"
  534.     "CurrOrMode 0 eq { \n"
  535.     "0 colorSet SetIndexedColor \n"
  536.     "newpath\n"
  537.     "x1 y1 moveto x2 y1 lineto\n"
  538.     "x2 y2 lineto x1 y2 lineto\n"
  539.     "closepath\n"
  540.     "fill\n"
  541.     "} if\n"
  542.     "ImageMaskColor colorSet SetIndexedColor \n"
  543.     "} if\n"
  544.     "newpath \n"
  545.     "geomProc \n"
  546.     "FillDict fillKey get exec \n"
  547.     "SetColorSet \n"
  548.     "end\n"
  549.     "end\n"
  550.     "} Bdef\n"
  551.     "} ifelse \n"
  552.     "languagelevel 2 lt { \n"
  553.     "/MakeShapeFont {\n"
  554.     "8 dict dup begin \n"
  555.     "4 1 roll \n"
  556.     "[3 1 roll]\n"
  557.     "/AdvanceVector Xdef \n"
  558.     "/Shape Xdef\n"
  559.     "/FontType 3 def\n"
  560.     "/FontMatrix [1 0 0 1 0 0] def \n"
  561.     "/FontBBox [ \n"
  562.     "Shape ShapeBBox\n"
  563.     "] def\n"
  564.     "/Encoding StandardEncoding def \n"
  565.     "/BuildChar /ShapeBuildChar load def\n"
  566.     "end\n"
  567.     "} Bdef\n"
  568.     "} if \n"
  569.     "/IsMatrixJustScaling {\n"
  570.     "dup 0 get \n"
  571.     "1 index 3 get \n"
  572.     "0.0 eq exch 0.0 eq and    \n"
  573.     "1 index 1 get \n"
  574.     "2 index 2 get \n"
  575.     "0.0 eq exch 0.0 eq and    \n"
  576.     "or \n"
  577.     "} Bdef\n"
  578.     "/PortMapping matrix def\n"
  579.     "/PortPatternMapping matrix def \n"
  580.     "/SaveCTMForPattern matrix def \n"
  581.     "/GridMatrix {\n"
  582.     "IsMatrixJustScaling { \n"
  583.     "0 1 3 { \n"
  584.     "dup \n"
  585.     "2 index exch \n"
  586.     "get dup abs 1.0 gt {    \n"
  587.     "round \n"
  588.     "} if\n"
  589.     "2 index \n"
  590.     "3 1 roll put \n"
  591.     "} for\n"
  592.     "} if\n"
  593.     "pop \n"
  594.     "} Bdef\n"
  595.     "/EnsureDeviceResolution {\n"
  596.     "ScratchMatrix currentmatrix    IsMatrixJustScaling {\n"
  597.     "0 1 3 { \n"
  598.     "dup 2 index exch \n"
  599.     "get dup abs 1.0 sub abs    .005 le { \n"
  600.     "0.0 lt {\n"
  601.     "-1.0 \n"
  602.     "} {\n"
  603.     "1.0\n"
  604.     "} ifelse\n"
  605.     "} if\n"
  606.     "2 index 3 1 roll put \n"
  607.     "} for\n"
  608.     "} if\n"
  609.     "setmatrix \n"
  610.     "} Bdef\n"
  611.     "/SetupPatternCTM {\n"
  612.     "SaveCTMForPattern currentmatrix pop\n"
  613.     "PortMap    { \n"
  614.     "PortMapping PortPatternMapping\n"
  615.     "copy dup GridMatrix \n"
  616.     "setmatrix \n"
  617.     "PortAllign not { \n"
  618.     "0 0 SaveCTMForPattern transform    itransform \n"
  619.     "translate\n"
  620.     "} if\n"
  621.     "} { \n"
  622.     "PortAllign { \n"
  623.     "0 0 PortMapping transform itransform\n"
  624.     "translate\n"
  625.     "} if\n"
  626.     "} ifelse\n"
  627.     "} Bdef\n"
  628.     "languagelevel 2 lt {\n"
  629.     "/MakePatternDict {\n"
  630.     "21 dict dup begin \n"
  631.     "10 1 roll \n"
  632.     "/PortAllign Xdef\n"
  633.     "/PortMap Xdef\n"
  634.     "/py Xdef /px Xdef\n"
  635.     "/vy Xdef /vx Xdef\n"
  636.     "/uy Xdef /ux Xdef\n"
  637.     "/patTransform [ \n"
  638.     "ux uy\n"
  639.     "vx vy\n"
  640.     "px py\n"
  641.     "] def\n"
  642.     "dup /shapeType get /b eq {\n"
  643.     "dup ShapeBBox \n"
  644.     "BoxWidths \n"
  645.     "vy ne vx 0 ne or \n"
  646.     "exch ux ne uy 0 ne or \n"
  647.     "or { \n"
  648.     "dup /shapeType /i put\n"
  649.     "} if\n"
  650.     "} if\n"
  651.     "ux uy MakeShapeFont \n"
  652.     "/patternFont exch definefont    \n"
  653.     "/patternFontDict Xdef \n"
  654.     "/IpatTransform \n"
  655.     "patTransform matrix\n"
  656.     "invertmatrix\n"
  657.     "def\n"
  658.     "end\n"
  659.     "} Bdef\n"
  660.     "} {    \n"
  661.     "/MakePatternDict {\n"
  662.     "10 dict dup begin \n"
  663.     "10 1 roll \n"
  664.     "/PatternType 1 def \n"
  665.     "/PortAllign Xdef \n"
  666.     "/PortMap Xdef \n"
  667.     "[ 7 1 roll ] \n"
  668.     "/patTransform Xdef \n"
  669.     "/XStep 1 def \n"
  670.     "/YStep 1 def\n"
  671.     "/TilingType CurrGridFit {2} {1} ifelse def \n"
  672.     "/PaintProc /PatternPaintProc load def \n"
  673.     "/IpatTransform \n"
  674.     "patTransform [0 0 0 0 0 0]\n"
  675.     "invertmatrix\n"
  676.     "def\n"
  677.     "/patShape Xdef \n"
  678.     "/BBox [\n"
  679.     "gsave\n"
  680.     "ScratchMatrix currentmatrix \n"
  681.     "IpatTransform concat \n"
  682.     "patShape /shapeType get /g eq { \n"
  683.     "patShape /geomProc get exec \n"
  684.     "setmatrix \n"
  685.     "/flattenpath 0 AvoidLimit pathbbox \n"
  686.     "} { \n"
  687.     "patShape ShapeBBox \n"
  688.     "4 2 roll 4 copy 4 2 roll BoxWidths RP \n"
  689.     "pop pop\n"
  690.     "setmatrix \n"
  691.     "pathbbox \n"
  692.     "} ifelse\n"
  693.     "grestore\n"
  694.     "] def\n"
  695.     "/PaintType \n"
  696.     "patShape /shapeType get dup /i eq exch /b eq or { \n"
  697.     "1 \n"
  698.     "} { \n"
  699.     "2 \n"
  700.     "}ifelse \n"
  701.     "def\n"
  702.     "end\n"
  703.     "dup /patTransform get \n"
  704.     "makepattern \n"
  705.     "} Bdef\n"
  706.     "} ifelse \n"
  707.     "languagelevel 2 lt {\n"
  708.     "/patternString 100 string def \n"
  709.     "/PatternFill {\n"
  710.     "CurrPat begin \n"
  711.     "gsave \n"
  712.     "SetupPatternCTM \n"
  713.     "patternFontDict /Shape get /shapeType get /b eq {\n"
  714.     "CurrOrMode 0 eq { \n"
  715.     "0 patternFontDict /Shape get /colorSet get SetIndexedColor \n"
  716.     "dup \n"
  717.     "gsave {fill} {eofill} ifelse grestore \n"
  718.     "} if\n"
  719.     "ImageMaskColor patternFontDict /Shape get /colorSet get SetIndexedColor \n"
  720.     "} { \n"
  721.     "patternFontDict /Shape get /shapeType get /i eq {\n"
  722.     "patternFontDict /Shape get dup /colorSet get dup \n"
  723.     "null ne { \n"
  724.     "SetColorSet \n"
  725.     "/BitsPerPixel get 2 exch exp 1 sub /MaxSampleInt exch store \n"
  726.     "InstallColorSetTransfers \n"
  727.     "} {\n"
  728.     "pop \n"
  729.     "pop \n"
  730.     "} ifelse\n"
  731.     "} if\n"
  732.     "} ifelse\n"
  733.     "{/clip 0 AvoidLimit}\n"
  734.     "{/eoclip 0 AvoidLimit}\n"
  735.     "ifelse \n"
  736.     "/flattenpath 0 AvoidLimit \n"
  737.     "/pathbbox    load stopped \n"
  738.     "{0 0 0 0} if \n"
  739.     "newpath \n"
  740.     "patternFontDict dup setfont \n"
  741.     "/FontBBox get \n"
  742.     "{} forall BoxWidths \n"
  743.     "6 2 roll \n"
  744.     "4 index add \n"
  745.     "exch \n"
  746.     "5 index add \n"
  747.     "4 2 roll \n"
  748.     "4 index sub \n"
  749.     "exch \n"
  750.     "5 index sub \n"
  751.     "exch 4 2 roll exch \n"
  752.     "/y2 Xdef\n"
  753.     "/x2 Xdef\n"
  754.     "/y1 Xdef\n"
  755.     "/x1 Xdef\n"
  756.     "x1 y1 IpatTransform transform pop \n"
  757.     "x1 y2 IpatTransform transform pop \n"
  758.     "Min \n"
  759.     "x2 y1 IpatTransform transform pop \n"
  760.     "x2 y2 IpatTransform transform pop \n"
  761.     "Min \n"
  762.     "Min floor /x1p Xdef \n"
  763.     "x1 y1 IpatTransform transform pop \n"
  764.     "x1 y2 IpatTransform transform pop \n"
  765.     "Max \n"
  766.     "x2 y1 IpatTransform transform pop \n"
  767.     "x2 y2 IpatTransform transform pop \n"
  768.     "Max \n"
  769.     "Max ceiling /x2p Xdef \n"
  770.     "x1 y1 IpatTransform transform exch pop \n"
  771.     "x2 y1 IpatTransform transform exch pop \n"
  772.     "Min \n"
  773.     "x1 y2 IpatTransform transform exch pop \n"
  774.     "x2 y2 IpatTransform transform exch pop \n"
  775.     "Min \n"
  776.     "Min floor /y1p Xdef \n"
  777.     "x1 y1 IpatTransform transform exch pop \n"
  778.     "x2 y1 IpatTransform transform exch pop \n"
  779.     "Max \n"
  780.     "x1 y2 IpatTransform transform exch pop \n"
  781.     "x2 y2 IpatTransform transform exch pop \n"
  782.     "Max \n"
  783.     "Max ceiling /y2p Xdef \n"
  784.     "/x1p x1p floor def\n"
  785.     "/y1p y1p floor def\n"
  786.     "/x2p x2p ceiling def\n"
  787.     "/y2p y2p ceiling def\n"
  788.     "pop pop \n"
  789.     "/lattWidth x2p x1p sub 1 add cvi def\n"
  790.     "y1p 1 y2p {\n"
  791.     "x1p exch patTransform transform moveto \n"
  792.     "0 100 lattWidth { \n"
  793.     "lattWidth exch sub \n"
  794.     "dup 100 gt { \n"
  795.     "pop 100 \n"
  796.     "} if \n"
  797.     "patternString 0 3 -1 roll getinterval \n"
  798.     "show \n"
  799.     "} for \n"
  800.     "} for\n"
  801.     "grestore\n"
  802.     "newpath\n"
  803.     "end\n"
  804.     "} Bdef\n"
  805.     "} if \n"
  806.     "/PathLength {\n"
  807.     "/@1 0 def \n"
  808.     "{ /@3 Xstore /@2 Xstore } \n"
  809.     "{ 2 copy \n"
  810.     "@3 sub dup mul \n"
  811.     "exch @2 sub dup mul \n"
  812.     "add sqrt \n"
  813.     "@1 add /@1 Xdef \n"
  814.     "/@3 Xstore /@2 Xstore    \n"
  815.     "}\n"
  816.     "{} \n"
  817.     "{} \n"
  818.     "/flattenpath 0 AvoidLimit    \n"
  819.     "pathforall\n"
  820.     "@1 \n"
  821.     "} Bdef\n"
  822.     "/MakeDashDict {\n"
  823.     "16 dict begin \n"
  824.     "/dashScale Xdef \n"
  825.     "/phase Xdef \n"
  826.     "/advance Xdef \n"
  827.     "/breakDash Xdef \n"
  828.     "/levelDash Xdef \n"
  829.     "/autoAdvance Xdef \n"
  830.     "/Shape Xdef \n"
  831.     "Shape ShapeBBox \n"
  832.     "pop exch pop 2 copy sub 2 div    \n"
  833.     "neg exch pop add \n"
  834.     "/xCenter Xdef \n"
  835.     "/FirstX null def /FirstY 0 def \n"
  836.     "/LastX 0 def /LastY 0 def\n"
  837.     "/CurrCTM matrix def \n"
  838.     "/N 0 def \n"
  839.     "currentdict \n"
  840.     "end\n"
  841.     "} Bdef\n"
  842.     "/StampDash {\n"
  843.     "LastX FirstX NotEqual\n"
  844.     "LastY FirstY NotEqual or { \n"
  845.     "CurrDash \n"
  846.     "currentlinewidth \n"
  847.     "null SetDash \n"
  848.     "CurrCTM currentmatrix \n"
  849.     "FirstX FirstY translate \n"
  850.     "levelDash not { \n"
  851.     "LastY FirstY sub \n"
  852.     "LastX FirstX sub\n"
  853.     "ATanRot\n"
  854.     "} if\n"
  855.     "1 currentlinewidth scale \n"
  856.     "0 setlinewidth \n"
  857.     "0 frameOffset translate \n"
  858.     "1 1 dashScale div scale \n"
  859.     "breakDash { \n"
  860.     "xCenter neg 0 translate\n"
  861.     "} if\n"
  862.     "newpath 0 0 moveto\n"
  863.     "Shape begin \n"
  864.     "geomProc \n"
  865.     "setmatrix \n"
  866.     "fillKey QD2Fill \n"
  867.     "end\n"
  868.     "setlinewidth \n"
  869.     "SetDash \n"
  870.     "} if\n"
  871.     "} Bdef\n"
  872.     "/DashLT {/LastY Xdef /LastX Xdef} Bdef\n"
  873.     "/DashCT {/LastY Xdef /LastX Xdef 4 {pop} repeat } Bdef\n"
  874.     "/DashCP {} Bdef\n"
  875.     "/DashMT {\n"
  876.     "FirstX null eq { \n"
  877.     "/FirstY Xdef \n"
  878.     "/FirstX Xdef\n"
  879.     "} { \n"
  880.     "2 copy \n"
  881.     "LastY ne exch \n"
  882.     "LastX ne or    { \n"
  883.     "StampDash \n"
  884.     "/FirstY Xdef \n"
  885.     "/FirstX Xdef\n"
  886.     "} { \n"
  887.     "pop pop \n"
  888.     "} ifelse\n"
  889.     "} ifelse\n"
  890.     "} Bdef\n"
  891.     "/DashStroke {\n"
  892.     "FullGsave\n"
  893.     "begin \n"
  894.     "CurrRightIsOut {neg} if \n"
  895.     "/frameOffset Xdef\n"
  896.     "Shape /colorSet get SetColorSet \n"
  897.     "Shape /ColorSpace get dup null ne { \n"
  898.     "GXSetCSpace\n"
  899.     "} {\n"
  900.     "pop\n"
  901.     "} ifelse\n"
  902.     "autoAdvance {\n"
  903.     "PathLength dup advance div floor /N Xdef \n"
  904.     "N div \n"
  905.     "} { \n"
  906.     "advance \n"
  907.     "} ifelse\n"
  908.     "/@1 Xdef \n"
  909.     "Shape    ShapeBBox \n"
  910.     "BoxWidths pop \n"
  911.     "dup 0 eq { \n"
  912.     "pop \n"
  913.     "@1 2 div \n"
  914.     "} if\n"
  915.     ".10 mul \n"
  916.     "dup @1 exch sub \n"
  917.     "[3 1 roll] \n"
  918.     "phase \n"
  919.     "breakDash {xCenter sub} if \n"
  920.     "setdash \n"
  921.     "currentlinewidth \n"
  922.     "0 setlinewidth \n"
  923.     "/strokepath 0 AvoidLimit \n"
  924.     "setlinewidth \n"
  925.     "[] 0 setdash \n"
  926.     "/FirstX null def \n"
  927.     "/DashMT load\n"
  928.     "/DashLT load\n"
  929.     "/DashCT load\n"
  930.     "/DashCP load \n"
  931.     "pathforall \n"
  932.     "FirstX null ne { \n"
  933.     "StampDash \n"
  934.     "} if \n"
  935.     "end\n"
  936.     "FullGrestore newpath\n"
  937.     "} Bdef\n"
  938.     "/FillDict 7 dict dup 3 -1 roll Xdef begin \n"
  939.     "/Fr {\n"
  940.     "CurrDash null eq { \n"
  941.     "CurrFrame dup 0 eq { \n"
  942.     "stroke \n"
  943.     "pop\n"
  944.     "} { \n"
  945.     "FillDict exch \n"
  946.     "-1 eq {/Of get} {/If get} ifelse\n"
  947.     "exec\n"
  948.     "} ifelse\n"
  949.     "} { \n"
  950.     "CurrFrame CurrDash DashStroke    \n"
  951.     "} ifelse\n"
  952.     "} Bdef\n"
  953.     "/If\n"
  954.     "{gsave clip currentlinewidth 2 mul setlinewidth stroke grestore newpath} Bdef\n"
  955.     "/Of\n"
  956.     "{gsave FullPath /eoclip 0 AvoidLimit currentlinewidth 2 mul setlinewidth stroke grestore newpath} Bdef\n"
  957.     "/Eo    /eofill load def\n"
  958.     "/In {FullPath eofill} Bdef\n"
  959.     "/W    /fill load def\n"
  960.     "/No {newpath} Bdef \n"
  961.     "end \n"
  962.     "languagelevel 1 eq {\n"
  963.     "/PatternFillDict 6 dict dup 3 -1 roll Xdef begin \n"
  964.     "/Fr {\n"
  965.     "CurrDash null eq { \n"
  966.     "CurrFrame dup 0 eq { \n"
  967.     "/strokepath 0 AvoidLimit true PatternFill \n"
  968.     "pop\n"
  969.     "} { \n"
  970.     "PatternFillDict exch \n"
  971.     "-1 eq {/Of get} {/If get} ifelse\n"
  972.     "exec\n"
  973.     "} ifelse\n"
  974.     "} { \n"
  975.     "CurrFrame CurrDash DashStroke    \n"
  976.     "} ifelse\n"
  977.     "} Bdef\n"
  978.     "/W {true PatternFill} Bdef\n"
  979.     "/Eo {false PatternFill} Bdef\n"
  980.     "/In {TightFullPath false PatternFill} Bdef\n"
  981.     "/If\n"
  982.     "{gsave clip currentlinewidth 2 mul setlinewidth strokepath\n"
  983.     "true exch PatternFill grestore newpath} Bdef\n"
  984.     "/Of\n"
  985.     "{gsave TightFullPath eoclip currentlinewidth 2 mul setlinewidth strokepath\n"
  986.     "true exch PatternFill grestore newpath} Bdef\n"
  987.     "end\n"
  988.     "} if \n"
  989.     "languagelevel 1 eq {\n"
  990.     "/QD2Fill {\n"
  991.     "CurrPat null eq { \n"
  992.     "FillDict \n"
  993.     "} { \n"
  994.     "PatternFillDict \n"
  995.     "} ifelse\n"
  996.     "exch get exec \n"
  997.     "} Bdef\n"
  998.     "} { \n"
  999.     "/OldColorAndSpace [] def \n"
  1000.     "/OldMatrix matrix def \n"
  1001.     "/InstallPatternColorSpace {\n"
  1002.     "CurrPat null ne { \n"
  1003.     "CurrPat begin\n"
  1004.     "PortMap PortAllign or {\n"
  1005.     "OldMatrix currentmatrix pop \n"
  1006.     "SetupPatternCTM\n"
  1007.     "SynchPatMatrix\n"
  1008.     "} if\n"
  1009.     "/OldColorAndSpace [\n"
  1010.     "currentcolor currentcolorspace    \n"
  1011.     "] store\n"
  1012.     "PaintType 2 eq {            \n"
  1013.     "currentcolor \n"
  1014.     "dup type /dicttype eq {pop} if \n"
  1015.     "} if\n"
  1016.     "end\n"
  1017.     "CurrPat setpattern \n"
  1018.     "} if\n"
  1019.     "} Bdef\n"
  1020.     "/RestoreOldColorAndSpace {\n"
  1021.     "CurrPat null ne {\n"
  1022.     "CurrPat /PortAllign get CurrPat /PortMap get or {\n"
  1023.     "OldMatrix setmatrix\n"
  1024.     "} if\n"
  1025.     "OldColorAndSpace aload pop \n"
  1026.     "setcolorspace setcolor \n"
  1027.     "} if\n"
  1028.     "} Bdef\n"
  1029.     "/QD2Fill {\n"
  1030.     "InstallPatternColorSpace\n"
  1031.     "FillDict \n"
  1032.     "exch get exec \n"
  1033.     "RestoreOldColorAndSpace\n"
  1034.     "} Bdef\n"
  1035.     "} ifelse \n"
  1036.     "/GlyphPaint {\n"
  1037.     "FullGsave \n"
  1038.     "exch \n"
  1039.     "HasBold { \n"
  1040.     "CurrBold \n"
  1041.     "AugGstate /FontMapping get \n"
  1042.     "dtransform \n"
  1043.     "SetBold \n"
  1044.     "} if\n"
  1045.     "{ \n"
  1046.     "aChar 0 3 -1 roll put \n"
  1047.     "dup \n"
  1048.     "currentpoint newpath moveto \n"
  1049.     "HasBold { \n"
  1050.     "currentpoint 3 -1 roll \n"
  1051.     "aChar true GXCharPath \n"
  1052.     "CurrCTM currentmatrix exch \n"
  1053.     "CurrBold scale \n"
  1054.     "currentlinewidth \n"
  1055.     "exch \n"
  1056.     "1 setlinewidth \n"
  1057.     "dup /W eq \n"
  1058.     "CurrPat null eq    and { \n"
  1059.     "stroke \n"
  1060.     "3 -1 roll setmatrix \n"
  1061.     "} { \n"
  1062.     "strokepath \n"
  1063.     "3 -1 roll setmatrix \n"
  1064.     "dup QD2Fill \n"
  1065.     "} ifelse\n"
  1066.     "exch setlinewidth \n"
  1067.     "3 1 roll \n"
  1068.     "moveto \n"
  1069.     "} if\n"
  1070.     "aChar true GXCharPath\n"
  1071.     "currentpoint \n"
  1072.     "3 -1 roll \n"
  1073.     "QD2Fill\n"
  1074.     "moveto \n"
  1075.     "} forall\n"
  1076.     "pop \n"
  1077.     "currentpoint \n"
  1078.     "FullGrestore \n"
  1079.     "moveto\n"
  1080.     "} Bdef\n"
  1081.     "/ShowDict 7 dict dup 3 -1 roll Xdef begin \n"
  1082.     "languagelevel 1 eq {\n"
  1083.     "/W {CurrPat null eq HasBold not and {show} {/W GlyphPaint} ifelse} Bdef\n"
  1084.     "} {\n"
  1085.     "/W {\n"
  1086.     "HasBold not {\n"
  1087.     "InstallPatternColorSpace show RestoreOldColorAndSpace\n"
  1088.     "} {\n"
  1089.     "/W GlyphPaint\n"
  1090.     "} ifelse\n"
  1091.     "} Bdef\n"
  1092.     "} ifelse \n"
  1093.     "/In {true GXCharPath /In QD2Fill} Bdef\n"
  1094.     "/Fr {/Fr GlyphPaint} Bdef\n"
  1095.     "/If {/If GlyphPaint} Bdef\n"
  1096.     "/Of {/Of GlyphPaint} Bdef\n"
  1097.     "/Eo    /W load def \n"
  1098.     "/No {pop} Bdef\n"
  1099.     "end\n"
  1100.     "/QD2Show {\n"
  1101.     "ShowDict exch get exec\n"
  1102.     "} Bdef\n"
  1103. };
  1104. resource 'wstr' (kStartProcId+3, sysHeap, purgeable) {
  1105.     "/ScaleMappingValues {\n"
  1106.     "1073741824 div \n"
  1107.     "7 1 roll\n"
  1108.     "6 {\n"
  1109.     "6 index div\n"
  1110.     "6 -1 roll\n"
  1111.     "} repeat\n"
  1112.     "7 -1 roll pop \n"
  1113.     "} Bdef\n"
  1114.     "/MakMatrix {\n"
  1115.     "ScaleMappingValues\n"
  1116.     "matrix astore\n"
  1117.     "} Bdef\n"
  1118.     "/MapCTM {\n"
  1119.     "ScaleMappingValues \n"
  1120.     "ScratchMatrix astore \n"
  1121.     "concat \n"
  1122.     "CurrPat null ne { \n"
  1123.     "SynchPatMatrix \n"
  1124.     "} if\n"
  1125.     "} Bdef\n"
  1126.     "/ClipDict 5 dict dup 3 -1 roll Xdef begin \n"
  1127.     "/Fr    {\n"
  1128.     "currentlinewidth \n"
  1129.     "0 setlinewidth \n"
  1130.     "/strokepath 0 AvoidLimit \n"
  1131.     "clip \n"
  1132.     "setlinewidth \n"
  1133.     "} Bdef\n"
  1134.     "/In {FullPath /eoclip 0 AvoidLimit} Bdef\n"
  1135.     "/Eo {/eoclip 0 AvoidLimit} Bdef\n"
  1136.     "/W {/clip 0 AvoidLimit} Bdef\n"
  1137.     "/No {\n"
  1138.     "newpath \n"
  1139.     "EmptyPath \n"
  1140.     "clip\n"
  1141.     "} Bdef\n"
  1142.     "end \n"
  1143.     "/QD2Clip {\n"
  1144.     "ClipDict exch get exec \n"
  1145.     "newpath \n"
  1146.     "} Bdef\n"
  1147.     "/MakeTrDict {\n"
  1148.     "7 dict begin \n"
  1149.     "/Mapping Xdef \n"
  1150.     "/ClipFill Xdef\n"
  1151.     "/ClipGeom Xdef\n"
  1152.     "/xTrans Mapping 4 get def \n"
  1153.     "/yTrans Mapping 5 get def\n"
  1154.     "/ClipGeom load 0 get /FullPath cvx eq ClipFill /Eo eq ClipFill /W eq or and not {\n"
  1155.     "/TrSetClip {ClipGeom ClipFill QD2Clip} BDef\n"
  1156.     "/isSimpleTranslation false def \n"
  1157.     "} {\n"
  1158.     "/TrSetClip {} def\n"
  1159.     "Mapping aload pop pop pop \n"
  1160.     "1 eq exch \n"
  1161.     "0 eq and exch \n"
  1162.     "0 eq and exch \n"
  1163.     "1 eq and \n"
  1164.     "/isSimpleTranslation Xdef\n"
  1165.     "} ifelse\n"
  1166.     "currentdict \n"
  1167.     "end\n"
  1168.     "} Bdef\n"
  1169.     "/SetTr {\n"
  1170.     "begin \n"
  1171.     "Mapping concat \n"
  1172.     "TrSetClip \n"
  1173.     "end \n"
  1174.     "} Bdef\n"
  1175. };
  1176. resource 'wstr' (kStartProcId+4, sysHeap, purgeable) {
  1177.     "/MakeFontClone {\n"
  1178.     "exch\n"
  1179.     "dup length 3 -1 roll add dict begin \n"
  1180.     "{\n"
  1181.     "1 index /FID ne 2 index /UniqueID ne and {def} {pop pop} ifelse\n"
  1182.     "} forall\n"
  1183.     "currentdict\n"
  1184.     "end\n"
  1185.     "} Bdef\n"
  1186.     "/MakeFramedFont {\n"
  1187.     "1 index /FontType get 0 ne { \n"
  1188.     "exch 2 MakeFontClone\n"
  1189.     "begin \n"
  1190.     "/PaintType 2 def \n"
  1191.     "0 FontMatrix idtransform pop \n"
  1192.     "/StrokeWidth Xdef\n"
  1193.     "currentdict\n"
  1194.     "end\n"
  1195.     "} { \n"
  1196.     "exch \n"
  1197.     "0 MakeFontClone begin \n"
  1198.     "FDepVector length array \n"
  1199.     "0 \n"
  1200.     "FDepVector { \n"
  1201.     "3 index \n"
  1202.     "MakeFramedFont /FDepFramedFont\n"
  1203.     "exch definefont \n"
  1204.     "3 copy put pop \n"
  1205.     "1 add \n"
  1206.     "} forall\n"
  1207.     "pop \n"
  1208.     "/FDepVector Xdef \n"
  1209.     "pop \n"
  1210.     "currentdict \n"
  1211.     "end\n"
  1212.     "} ifelse\n"
  1213.     "} Bdef\n"
  1214.     "/MakeVerticalFont {\n"
  1215.     "dup /WMode known {0} {1} ifelse MakeFontClone\n"
  1216.     "dup begin\n"
  1217.     "/WMode 1 def\n"
  1218.     "end\n"
  1219.     "} Bdef\n"
  1220.     "/BoldBuildChar {\n"
  1221.     "exch begin\n"
  1222.     "theChar 0 3 -1 roll put \n"
  1223.     "baseFontDict setfont\n"
  1224.     "theChar stringwidth \n"
  1225.     "dup 0 ne {yBold add} if \n"
  1226.     "exch\n"
  1227.     "dup 0 ne {xBold add} if \n"
  1228.     "exch\n"
  1229.     "gsave\n"
  1230.     "newpath\n"
  1231.     "0 0 moveto\n"
  1232.     "theChar false GXCharPath \n"
  1233.     "gsave\n"
  1234.     "xBold 2 mul yBold 2 mul scale 1 setlinewidth strokepath\n"
  1235.     "pathbbox\n"
  1236.     "grestore\n"
  1237.     "grestore\n"
  1238.     "setcachedevice\n"
  1239.     "newpath\n"
  1240.     "0 0 moveto theChar true GXCharPath\n"
  1241.     "currentlinewidth \n"
  1242.     "xBold 2 mul \n"
  1243.     "yBold 2 mul\n"
  1244.     "scale\n"
  1245.     "1 setlinewidth \n"
  1246.     "CharPathCount 0 eq {stroke} {strokepath} ifelse\n"
  1247.     "1 xBold 2 mul div 1 yBold 2 mul div scale \n"
  1248.     "setlinewidth \n"
  1249.     "0 0 moveto\n"
  1250.     "theChar CharPathCount 0 eq {show} {true charpath} ifelse\n"
  1251.     "end\n"
  1252.     "} Bdef\n"
  1253.     "/MakeBoldFont {\n"
  1254.     "20 dict dup begin \n"
  1255.     "4 1 roll \n"
  1256.     "/yBold Xdef \n"
  1257.     "/xBold Xdef\n"
  1258.     "/baseFontDict Xdef \n"
  1259.     "/theChar 1 string def \n"
  1260.     "baseFontDict /Encoding get /Encoding Xdef \n"
  1261.     "/FontType 3 def \n"
  1262.     "/FontMatrix [1 0 0 1 0 0] def \n"
  1263.     "/FontBBox [0 0 0 0] def \n"
  1264.     "/BuildChar /BoldBuildChar load def\n"
  1265.     "end\n"
  1266.     "} Bdef\n"
  1267. };
  1268. resource 'wstr' (kStartProcId+5, sysHeap, purgeable) {
  1269.     "/GXkshow /kshow load def \n"
  1270.     "/cshow where {pop} {save} ifelse \n"
  1271.     "/type0String null def\n"
  1272.     "/type0Char 1 string def\n"
  1273.     "/type0firstChar true def\n"
  1274.     "/GXkshow {\n"
  1275.     "currentfont /FontType get 0 ne {\n"
  1276.     "kshow\n"
  1277.     "} {\n"
  1278.     "/type0String Xstore\n"
  1279.     "/kshowProc Xstore\n"
  1280.     "/type0firstChar true store\n"
  1281.     "{ \n"
  1282.     "pop pop \n"
  1283.     "type0Char exch 0 exch put \n"
  1284.     "type0firstChar { \n"
  1285.     "/type0firstChar false store\n"
  1286.     "} { \n"
  1287.     "-1 -1 kshowProc \n"
  1288.     "} ifelse\n"
  1289.     "type0Char show \n"
  1290.     "} type0String cshow\n"
  1291.     "} ifelse\n"
  1292.     "} bind def\n"
  1293.     "/cshow where {pop} {restore} ifelse \n"
  1294.     "/KshowAbsPos {\n"
  1295.     "pop pop \n"
  1296.     "moveto \n"
  1297.     "} Bdef\n"
  1298.     "/KshowAbsPosH {\n"
  1299.     "pop pop \n"
  1300.     "dup \n"
  1301.     "3 1 roll \n"
  1302.     "moveto \n"
  1303.     "} Bdef\n"
  1304.     "/KshowAbsPosV {\n"
  1305.     "pop pop \n"
  1306.     "dup \n"
  1307.     "3 1 roll \n"
  1308.     "exch \n"
  1309.     "moveto \n"
  1310.     "} Bdef\n"
  1311.     "/KshowDelta {\n"
  1312.     "pop pop \n"
  1313.     "rmoveto \n"
  1314.     "} Bdef\n"
  1315.     "/KshowDeltaH {\n"
  1316.     "pop pop \n"
  1317.     "dup \n"
  1318.     "3 1 roll \n"
  1319.     "rmoveto \n"
  1320.     "} Bdef\n"
  1321.     "/KshowDeltaV {\n"
  1322.     "pop pop \n"
  1323.     "dup \n"
  1324.     "3 1 roll \n"
  1325.     "exch \n"
  1326.     "rmoveto \n"
  1327.     "} Bdef\n"
  1328.     "/CnstDltShw {\n"
  1329.     "3 1 roll \n"
  1330.     "2 copy \n"
  1331.     "5 -1 roll \n"
  1332.     "ashow \n"
  1333.     "neg exch neg exch \n"
  1334.     "rmoveto \n"
  1335.     "} Bdef\n"
  1336. };
  1337. resource 'wstr' (kStartProcId+6, sysHeap, purgeable) {
  1338.     "/ReadRaster { currentfile pixString RstrRead pop } Bdef\n"
  1339.     "/pixString null def\n"
  1340.     "/MaxSampleInt 0 def\n"
  1341.     "/OldGrayTransfer null def\n"
  1342.     "/OldBlackTransfer null def\n"
  1343.     "/OldRedTransfer null def\n"
  1344.     "/OldGreenTransfer null def\n"
  1345.     "/OldBlueTransfer null def\n"
  1346.     "/OldCyanTransfer null def\n"
  1347.     "/OldMagentaTransfer null def\n"
  1348.     "/OldYellowTransfer null def\n"
  1349.     "/DoBitmap { save \n"
  1350.     "9 1 roll \n"
  1351.     "/pixString exch string store \n"
  1352.     "/RstrRead exch \n"
  1353.     "{/readhexstring}\n"
  1354.     "{/readstring}\n"
  1355.     "ifelse\n"
  1356.     "load def\n"
  1357.     "1 0 0 1 \n"
  1358.     "6 -2 roll neg exch neg exch \n"
  1359.     "ScratchMatrix astore \n"
  1360.     "/ReadRaster load \n"
  1361.     "6 -1 roll dup 1 gt { \n"
  1362.     "false exch \n"
  1363.     "GXColorImage \n"
  1364.     "} { \n"
  1365.     "pop \n"
  1366.     "image \n"
  1367.     "} ifelse\n"
  1368.     "restore } Bdef\n"
  1369.     "/DoImageMask { save\n"
  1370.     "1 index type /arraytype eq { \n"
  1371.     "exch concat \n"
  1372.     "1 SetOrMode \n"
  1373.     "EnsureDeviceResolution \n"
  1374.     "} if\n"
  1375.     "7 1 roll \n"
  1376.     "/pixString exch string store \n"
  1377.     "/RstrRead exch \n"
  1378.     "{/readhexstring}\n"
  1379.     "{/readstring}\n"
  1380.     "ifelse\n"
  1381.     "load def\n"
  1382.     "1 0 0 1 \n"
  1383.     "6 -2 roll neg exch neg exch \n"
  1384.     "ScratchMatrix astore \n"
  1385.     "ImageMaskSense exch \n"
  1386.     "/ReadRaster load \n"
  1387.     "gsave ImageMaskColor CurrColorSet SetIndexedColor\n"
  1388.     "imagemask    \n"
  1389.     "grestore\n"
  1390.     "restore } Bdef\n"
  1391.     "/MakeBitmapStrings {\n"
  1392.     "/@1 Xstore \n"
  1393.     "[ \n"
  1394.     "@1 -65535 0 { \n"
  1395.     "dup 65535 gt { \n"
  1396.     "pop 65535 string \n"
  1397.     "} { \n"
  1398.     "string \n"
  1399.     "} ifelse\n"
  1400.     "} for\n"
  1401.     "] \n"
  1402.     "exch\n"
  1403.     "/RstrRead exch \n"
  1404.     "{/readhexstring}\n"
  1405.     "{/readstring}\n"
  1406.     "ifelse\n"
  1407.     "load def\n"
  1408.     "dup \n"
  1409.     "{ \n"
  1410.     "currentfile exch RstrRead pop pop\n"
  1411.     "} forall\n"
  1412.     "} Bdef\n"
  1413.     "/StringDataIn {\n"
  1414.     "2 copy get exch 1 add exch\n"
  1415.     "} Bdef\n"
  1416.     "/DrawBitmapString {\n"
  1417.     "1 0 0 1 \n"
  1418.     "6 -2 roll neg exch neg exch \n"
  1419.     "ScratchMatrix astore \n"
  1420.     "/StringDataIn load \n"
  1421.     "BitmapStrings 0 \n"
  1422.     "8 2 roll \n"
  1423.     "6 -1 roll dup 1 gt { \n"
  1424.     "false exch \n"
  1425.     "GXColorImage \n"
  1426.     "} { \n"
  1427.     "pop \n"
  1428.     "image \n"
  1429.     "} ifelse\n"
  1430.     "pop pop \n"
  1431.     "} Bdef\n"
  1432.     "/Draw1bitBitmapString {\n"
  1433.     "shapeType /i eq CurrOrMode 0 eq and { \n"
  1434.     "1 \n"
  1435.     "3 1 roll \n"
  1436.     "DrawIndexedBitmapStrings    \n"
  1437.     "} {\n"
  1438.     "1 0 0 1 \n"
  1439.     "6 -2 roll neg exch neg exch \n"
  1440.     "ScratchMatrix astore \n"
  1441.     "ImageMaskSense exch \n"
  1442.     "/StringDataIn load \n"
  1443.     "BitmapStrings 0 \n"
  1444.     "7 2 roll \n"
  1445.     "imagemask \n"
  1446.     "pop pop \n"
  1447.     "} ifelse\n"
  1448.     "} Bdef\n"
  1449.     "languagelevel 1 eq { \n"
  1450.     "statusdict /processcolors known { \n"
  1451.     "statusdict /processcolors \n"
  1452.     "get exec 4 ne \n"
  1453.     "} { \n"
  1454.     "true \n"
  1455.     "}ifelse\n"
  1456.     "} { \n"
  1457.     "true \n"
  1458.     "} ifelse\n"
  1459.     "{save true} {false} ifelse \n"
  1460.     "/RGBtoCMYKColorSetParams {\n"
  1461.     "dup 3 eq { \n"
  1462.     "5 -3 roll \n"
  1463.     "dup length array \n"
  1464.     "0 1 2 index length 1 sub \n"
  1465.     "{ \n"
  1466.     "dup 5 index exch get exch \n"
  1467.     "dup 5 index exch get exch \n"
  1468.     "dup 5 index exch get exch \n"
  1469.     "4 1 roll \n"
  1470.     "setrgbcolor currentcmykcolor    \n"
  1471.     "5 index 5 index 3 -1 roll \n"
  1472.     "put \n"
  1473.     "5 index 4 index 3 -1 roll \n"
  1474.     "put \n"
  1475.     "5 index 3 index 3 -1 roll \n"
  1476.     "put \n"
  1477.     "5 index 2 index 3 -1 roll \n"
  1478.     "put \n"
  1479.     "pop \n"
  1480.     "} for\n"
  1481.     "6 -2 roll \n"
  1482.     "pop 4 \n"
  1483.     "} if \n"
  1484.     "} Bdef\n"
  1485.     "{restore} if \n"
  1486.     "/CreateColorSet {\n"
  1487.     "currentdict /PortablizeColorSetParams known {PortablizeColorSetParams} if \n"
  1488.     "currentdict /RGBtoCMYKColorSetParams known {RGBtoCMYKColorSetParams} if \n"
  1489.     "5 dict begin \n"
  1490.     "exch \n"
  1491.     "/ColorSpace Xdef \n"
  1492.     "1 index length /Size Xdef \n"
  1493.     "dup /Num Xdef \n"
  1494.     "array \n"
  1495.     "astore \n"
  1496.     "/Components Xdef \n"
  1497.     "ColorSpace null eq { \n"
  1498.     "/SetColorOp\n"
  1499.     "Num 1 eq {                            \n"
  1500.     "/setgray load def \n"
  1501.     "}    { \n"
  1502.     "Num 3 eq { \n"
  1503.     "/GXSetRGBColor load def \n"
  1504.     "} { \n"
  1505.     "/setcmykcolor load def \n"
  1506.     "}    ifelse\n"
  1507.     "}    ifelse\n"
  1508.     "} { \n"
  1509.     "/SetColorOp /setcolor load def\n"
  1510.     "} ifelse\n"
  1511.     "currentdict end\n"
  1512.     "} Bdef\n"
  1513.     "/SetIndexedColor {\n"
  1514.     "begin\n"
  1515.     "ColorSpace null ne {ColorSpace GXSetCSpace} if \n"
  1516.     "Components {1 index get exch} forall pop \n"
  1517.     "SetColorOp\n"
  1518.     "end\n"
  1519.     "} Bdef\n"
  1520.     "languagelevel 2 ge {\n"
  1521.     "/LookupProc {\n"
  1522.     "CurrColorSet /Components get { \n"
  1523.     "1 index dup \n"
  1524.     "CurrColorSet /Size get ge {            \n"
  1525.     "pop pop 0 \n"
  1526.     "} { \n"
  1527.     "get \n"
  1528.     "}    ifelse\n"
  1529.     "exch \n"
  1530.     "} forall \n"
  1531.     "pop \n"
  1532.     "} Bdef\n"
  1533.     "} if\n"
  1534.     "languagelevel 2 ge {\n"
  1535.     "/DoIndexedBitmap { save\n"
  1536.     "8 1 roll \n"
  1537.     "dup 0 gt {\n"
  1538.     "/pixString exch string store \n"
  1539.     "/RstrRead exch \n"
  1540.     "{/readhexstring}\n"
  1541.     "{/readstring} \n"
  1542.     "ifelse\n"
  1543.     "load def\n"
  1544.     "} {\n"
  1545.     "pop pop \n"
  1546.     "/pixString null store \n"
  1547.     "} ifelse\n"
  1548.     "1 0 0 1\n"
  1549.     "6 -2 roll neg exch neg exch \n"
  1550.     "ScratchMatrix astore \n"
  1551.     "[\n"
  1552.     "/Indexed\n"
  1553.     "CurrColorSet begin \n"
  1554.     "ColorSpace null eq { \n"
  1555.     "Num 1 eq \n"
  1556.     "{/DeviceGray}\n"
  1557.     "{ Num 3 eq\n"
  1558.     "{/DeviceRGB} \n"
  1559.     "{/DeviceCMYK} \n"
  1560.     "ifelse\n"
  1561.     "}    ifelse\n"
  1562.     "} { \n"
  1563.     "ColorSpace /CSA get\n"
  1564.     "} ifelse\n"
  1565.     "Size \n"
  1566.     "end\n"
  1567.     "/LookupProc load \n"
  1568.     "] setcolorspace\n"
  1569.     "CurrColorSet /ColorSpace get dup null ne {GXSetCRD} {pop} ifelse\n"
  1570.     "7 dict dup begin\n"
  1571.     "5 1 roll\n"
  1572.     "/ImageMatrix Xdef\n"
  1573.     "/BitsPerComponent Xdef\n"
  1574.     "/Height Xdef\n"
  1575.     "/Width Xdef\n"
  1576.     "/ImageType 1 def\n"
  1577.     "/Decode [0 2 BitsPerComponent exp 1 sub] def\n"
  1578.     "pixString null ne {\n"
  1579.     "/DataSource /ReadRaster load def\n"
  1580.     "} {\n"
  1581.     "/DataSource /StringDataIn load def\n"
  1582.     "BitmapStrings 0 \n"
  1583.     "3 2 roll \n"
  1584.     "} ifelse\n"
  1585.     "end\n"
  1586.     "image \n"
  1587.     "pixString null eq {pop pop} if\n"
  1588.     "restore } Bdef\n"
  1589.     "} if\n"
  1590.     "languagelevel 1 eq {\n"
  1591.     "/MaxSampleInt 0 store \n"
  1592.     "/LookupComponent {\n"
  1593.     "CurrColorSet /Components get \n"
  1594.     "exch get \n"
  1595.     "exch MaxSampleInt mul round cvi \n"
  1596.     "dup\n"
  1597.     "CurrColorSet /Size get ge { \n"
  1598.     "pop pop 0\n"
  1599.     "} {\n"
  1600.     "get\n"
  1601.     "} ifelse\n"
  1602.     "} Bdef\n"
  1603.     "/DoIndexedBitmap { save\n"
  1604.     "8 1 roll \n"
  1605.     "dup 0 gt { \n"
  1606.     "/pixString exch string store \n"
  1607.     "/RstrRead exch \n"
  1608.     "{/readhexstring}\n"
  1609.     "{/readstring} \n"
  1610.     "ifelse\n"
  1611.     "load def\n"
  1612.     "2 index 2 exch exp 1 sub /MaxSampleInt exch store \n"
  1613.     "InstallColorSetTransfers \n"
  1614.     "} { \n"
  1615.     "pop pop \n"
  1616.     "/pixString null store \n"
  1617.     "} ifelse\n"
  1618.     "1 0 0 1\n"
  1619.     "6 -2 roll neg exch neg exch \n"
  1620.     "ScratchMatrix astore \n"
  1621.     "CurrColorSet /Num get dup 1 eq { \n"
  1622.     "pop \n"
  1623.     "pixString null ne {\n"
  1624.     "/ReadRaster load \n"
  1625.     "} {\n"
  1626.     "/StringDataIn load\n"
  1627.     "BitmapStrings 0 7 2 roll\n"
  1628.     "} ifelse\n"
  1629.     "image\n"
  1630.     "} { \n"
  1631.     "3 eq { \n"
  1632.     "pixString null ne {\n"
  1633.     "{ReadRaster dup dup} {} {} \n"
  1634.     "} {\n"
  1635.     "{StringDataIn dup dup} {} {} BitmapStrings 0 9 2 roll\n"
  1636.     "} ifelse\n"
  1637.     "true 3 GXColorImage\n"
  1638.     "} { \n"
  1639.     "pixString null ne {\n"
  1640.     "{ReadRaster dup dup dup } {} {} {}\n"
  1641.     "} {\n"
  1642.     "{StringDataIn dup dup dup} {} {} {} BitmapStrings 0 10 2 roll\n"
  1643.     "} ifelse\n"
  1644.     "true 4 GXColorImage\n"
  1645.     "} ifelse\n"
  1646.     "} ifelse\n"
  1647.     "pixString null eq {pop pop} if \n"
  1648.     "restore } Bdef\n"
  1649.     "} if\n"
  1650.     "languagelevel 1 eq {\n"
  1651.     "/InstallColorSetTransfers {\n"
  1652.     "CurrColorSet /Num get dup 1 eq { \n"
  1653.     "/OldGrayTransfer currenttransfer store\n"
  1654.     "{0 LookupComponent OldGrayTransfer} settransfer\n"
  1655.     "pop \n"
  1656.     "} { \n"
  1657.     "3 eq { \n"
  1658.     "currentcolortransfer\n"
  1659.     "/OldGrayTransfer exch store\n"
  1660.     "/OldBlueTransfer exch store\n"
  1661.     "/OldGreenTransfer exch store\n"
  1662.     "/OldRedTransfer exch store\n"
  1663.     "{0 LookupComponent OldRedTransfer}\n"
  1664.     "{1 LookupComponent OldGreenTransfer}\n"
  1665.     "{2 LookupComponent OldBlueTransfer}\n"
  1666.     "{OldGrayTransfer}\n"
  1667.     "setcolortransfer\n"
  1668.     "} { \n"
  1669.     "currentcolortransfer\n"
  1670.     "/OldBlackTransfer exch store\n"
  1671.     "/OldYellowTransfer exch store\n"
  1672.     "/OldMagentaTransfer exch store\n"
  1673.     "/OldCyanTransfer exch store\n"
  1674.     "{1 exch sub 0 LookupComponent 1 exch sub OldCyanTransfer}\n"
  1675.     "{1 exch sub 1 LookupComponent 1 exch sub OldMagentaTransfer}\n"
  1676.     "{1 exch sub 2 LookupComponent 1 exch sub OldYellowTransfer}\n"
  1677.     "{1 exch sub 3 LookupComponent 1 exch sub OldBlackTransfer}\n"
  1678.     "setcolortransfer\n"
  1679.     "} ifelse\n"
  1680.     "} ifelse\n"
  1681.     "} Bdef\n"
  1682.     "} if\n"
  1683.     "/DrawIndexedBitmapStrings {\n"
  1684.     "F 0 DoIndexedBitmap \n"
  1685.     "} Bdef\n"
  1686.     "/Do1bitBitmap {\n"
  1687.     "dup type /arraytype eq \n"
  1688.     "CurrOrMode 0 ne or { \n"
  1689.     "DoImageMask\n"
  1690.     "} { \n"
  1691.     "1 \n"
  1692.     "5 1 roll    \n"
  1693.     "DoIndexedBitmap\n"
  1694.     "} ifelse\n"
  1695.     "} Bdef\n"
  1696.     "/SetImageDecodeEntry {\n"
  1697.     "/Decode [0 1.0 0 1.0 0 1.0] def \n"
  1698.     "currentcolorspace 0 get /CIEBasedABC eq { \n"
  1699.     "currentcolorspace 1 get dup /RangeABC known { \n"
  1700.     "/RangeABC get /Decode exch def \n"
  1701.     "} { \n"
  1702.     "pop \n"
  1703.     "} ifelse \n"
  1704.     "} if\n"
  1705.     "} bind def\n"
  1706.     "languagelevel 2 ge {\n"
  1707.     "/DoLevel2ColorImage {\n"
  1708.     "9 dict begin\n"
  1709.     "/ImageType 1 def\n"
  1710.     "{\n"
  1711.     "/DataSource currentfile /ASCIIHexDecode filter def\n"
  1712.     "} {\n"
  1713.     "/DataSource currentfile def\n"
  1714.     "} ifelse\n"
  1715.     "neg exch neg exch matrix translate /ImageMatrix Xdef\n"
  1716.     "/BitsPerComponent Xdef\n"
  1717.     "/Height Xdef\n"
  1718.     "/Width Xdef\n"
  1719.     "SetImageDecodeEntry \n"
  1720.     "currentdict \n"
  1721.     "end\n"
  1722.     "image \n"
  1723.     "} Bdef\n"
  1724.     "/DoLevel2ColorImageString {\n"
  1725.     "9 dict begin\n"
  1726.     "/ImageType 1 def\n"
  1727.     "/DataSource /StringDataIn load def    \n"
  1728.     "neg exch neg exch matrix translate /ImageMatrix Xdef\n"
  1729.     "/BitsPerComponent Xdef\n"
  1730.     "/Height Xdef\n"
  1731.     "/Width Xdef\n"
  1732.     "SetImageDecodeEntry \n"
  1733.     "BitmapStrings 0    \n"
  1734.     "currentdict \n"
  1735.     "end\n"
  1736.     "image \n"
  1737.     "pop pop \n"
  1738.     "} Bdef\n"
  1739.     "} if \n"
  1740. };
  1741. resource 'wstr' (kStartProcId+7, sysHeap, purgeable) {
  1742.     "/BBoxPath {\n"
  1743.     "3 index 3 index \n"
  1744.     "moveto \n"
  1745.     "3 index 1 index \n"
  1746.     "lineto \n"
  1747.     "2 copy \n"
  1748.     "lineto \n"
  1749.     "pop 1 index \n"
  1750.     "lineto lineto\n"
  1751.     "closepath\n"
  1752.     "} Bdef\n"
  1753.     "/SaveMatrix matrix def\n"
  1754.     "/SaveFont null def\n"
  1755.     "/StringBBox {\n"
  1756.     "currentpoint 3 -1 roll \n"
  1757.     "SaveMatrix currentmatrix pop \n"
  1758.     "initmatrix \n"
  1759.     "currentpoint translate \n"
  1760.     "currentfont dup /SaveFont Xstore    \n"
  1761.     "100 scalefont \n"
  1762.     "setfont \n"
  1763.     "false userdict /charpath known {    \n"
  1764.     "userdict /charpath get exec \n"
  1765.     "} { \n"
  1766.     "charpath \n"
  1767.     "} ifelse\n"
  1768.     "pathbbox \n"
  1769.     "4 {100 div 4 1 roll} repeat \n"
  1770.     "newpath\n"
  1771.     "SaveMatrix setmatrix\n"
  1772.     "SaveFont setfont\n"
  1773.     "6 -2 roll \n"
  1774.     "2 copy \n"
  1775.     "translate \n"
  1776.     "6 2 roll \n"
  1777.     "transform \n"
  1778.     "4 2 roll transform \n"
  1779.     "4 2 roll \n"
  1780.     "6 -2 roll \n"
  1781.     "neg exch neg exch \n"
  1782.     "translate \n"
  1783.     "itransform 4 2 roll \n"
  1784.     "itransform 4 2 roll \n"
  1785.     "} Bdef\n"
  1786.     "/AddBBoxes {\n"
  1787.     "4 index null ne { \n"
  1788.     "4 index Max\n"
  1789.     "4 1 roll\n"
  1790.     "5 index Max\n"
  1791.     "4 1 roll\n"
  1792.     "6 index Min\n"
  1793.     "4 1 roll\n"
  1794.     "7 index Min\n"
  1795.     "4 1 roll\n"
  1796.     "8 4 roll\n"
  1797.     "pop pop pop pop\n"
  1798.     "} {\n"
  1799.     "5 -1 roll pop \n"
  1800.     "} ifelse\n"
  1801.     "} Bdef\n"
  1802.     "/LW8LayerBuildChar {\n"
  1803.     "exch begin \n"
  1804.     "Moby begin \n"
  1805.     "baseFont setfont\n"
  1806.     "theChar exch 0 exch put \n"
  1807.     "theChar stringwidth \n"
  1808.     "advanceMapping transform \n"
  1809.     "setcharwidth \n"
  1810.     "faceLayers {\n"
  1811.     "gsave\n"
  1812.     "begin \n"
  1813.     "fillKey /No ne { \n"
  1814.     "LayerFont setfont \n"
  1815.     "whiteLayer {1.0 setgray} if \n"
  1816.     "outlineTransform begin \n"
  1817.     "isSimpleTranslation { \n"
  1818.     "xTrans yTrans moveto \n"
  1819.     "} { \n"
  1820.     "Mapping concat \n"
  1821.     "TrSetClip \n"
  1822.     "0 0 moveto \n"
  1823.     "} ifelse\n"
  1824.     "end \n"
  1825.     "theChar show \n"
  1826.     "} if\n"
  1827.     "end\n"
  1828.     "grestore\n"
  1829.     "} forall\n"
  1830.     "end \n"
  1831.     "end\n"
  1832.     "} Bdef\n"
  1833.     "/AdvanceMappingBuildChar {\n"
  1834.     "exch begin \n"
  1835.     "theChar 0 3 -1 roll put \n"
  1836.     "baseFont setfont\n"
  1837.     "theChar stringwidth\n"
  1838.     "advanceMapping transform \n"
  1839.     "setcharwidth \n"
  1840.     "0 0 moveto\n"
  1841.     "theChar show\n"
  1842.     "end\n"
  1843.     "} Bdef\n"
  1844.     "/TextFaceSetupFontCache {\n"
  1845.     "6 copy \n"
  1846.     "languagelevel 2 ge HasPattern and { \n"
  1847.     "pop pop pop pop setcharwidth \n"
  1848.     "} { \n"
  1849.     "setcachedevice \n"
  1850.     "}    ifelse\n"
  1851.     "2 copy 6 -2 roll \n"
  1852.     "BoxWidths \n"
  1853.     "RCl \n"
  1854.     "pop pop\n"
  1855.     "} Bdef\n"
  1856.     "/ComputeLayerBBox {\n"
  1857.     "LayerFont setfont \n"
  1858.     "newpath 0 0 moveto \n"
  1859.     "theChar StringBBox \n"
  1860.     "/Y3 Xdef /X3 Xdef \n"
  1861.     "/Y1 Xdef /X1 Xdef \n"
  1862.     "/X2 X3 def    /Y2 Y1 def \n"
  1863.     "/X4 X1 def    /Y4 Y3 def \n"
  1864.     "X1 Y1 outlineTransform /Mapping get transform /Y1 Xdef /X1 Xdef\n"
  1865.     "X2 Y2 outlineTransform /Mapping get transform /Y2 Xdef /X2 Xdef\n"
  1866.     "X3 Y3 outlineTransform /Mapping get transform /Y3 Xdef /X3 Xdef\n"
  1867.     "X4 Y4 outlineTransform /Mapping get transform /Y4 Xdef /X4 Xdef\n"
  1868.     "X1 X2 Min X3 Min X4 Min \n"
  1869.     "Y1 Y2 Min Y3 Min Y4 Min \n"
  1870.     "X1 X2 Max X3 Max X4 Max \n"
  1871.     "Y1 Y2 Max Y3 Max Y4 Max \n"
  1872.     "/LayerBBoxGrowX xBold 2 div def \n"
  1873.     "/LayerBBoxGrowY yBold 2 div def\n"
  1874.     "fillKey /Fr eq LayerFont /PaintType 2 copy known {get} {pop pop 0} ifelse 2 eq or {\n"
  1875.     "outlineStyle /pen get dup dtransform \n"
  1876.     "2.0 Max exch 2.0 Max exch \n"
  1877.     "idtransform \n"
  1878.     "Max \n"
  1879.     "/LayerPen exch def \n"
  1880.     "outlineStyle /dash get null ne { \n"
  1881.     "outlineStyle /dash get /Shape get ShapeBBox \n"
  1882.     "BoxWidths exch pop \n"
  1883.     "LayerPen 2 div mul dup \n"
  1884.     "LayerBBoxGrowY add /LayerBBoxGrowY Xdef \n"
  1885.     "LayerBBoxGrowX add /LayerBBoxGrowX Xdef \n"
  1886.     "} { \n"
  1887.     "LayerBBoxGrowY LayerPen 2 div add /LayerBBoxGrowY Xdef\n"
  1888.     "LayerBBoxGrowX LayerPen 2 div add /LayerBBoxGrowX Xdef\n"
  1889.     "} ifelse\n"
  1890.     "} if\n"
  1891.     "LayerBBoxGrowY add \n"
  1892.     "exch LayerBBoxGrowX add \n"
  1893.     "4 2 roll \n"
  1894.     "LayerBBoxGrowY sub \n"
  1895.     "exch LayerBBoxGrowX sub \n"
  1896.     "exch 4 2 roll exch \n"
  1897.     "} Bdef    \n"
  1898.     "/ComputeFaceBBox {\n"
  1899.     "null \n"
  1900.     "faceLayers {\n"
  1901.     "begin \n"
  1902.     "whiteLayer not fillKey /No ne and { \n"
  1903.     "ComputeLayerBBox \n"
  1904.     "AddBBoxes \n"
  1905.     "} if\n"
  1906.     "end\n"
  1907.     "} forall    \n"
  1908.     "dup null eq { \n"
  1909.     "pop \n"
  1910.     "0 0 0 0 \n"
  1911.     "} if\n"
  1912.     "} Bdef\n"
  1913.     "/LayerBuildChar {\n"
  1914.     "/TextFaceSave save store \n"
  1915.     "Moby begin \n"
  1916.     "1 0 0 1 0 0 \n"
  1917.     "AugGstate /FontMapping get    \n"
  1918.     "astore pop\n"
  1919.     "exch begin \n"
  1920.     "theChar exch 0 exch put \n"
  1921.     "baseFont setfont \n"
  1922.     "theChar stringwidth \n"
  1923.     "autoAdvance {\n"
  1924.     "ComputeFaceBBox \n"
  1925.     "4 copy \n"
  1926.     "10 4 roll \n"
  1927.     "baseFont setfont\n"
  1928.     "newpath\n"
  1929.     "0 0 moveto\n"
  1930.     "theChar StringBBox\n"
  1931.     "BoxWidths\n"
  1932.     "6 2 roll\n"
  1933.     "BoxWidths\n"
  1934.     "BoxWidths\n"
  1935.     "4 2 roll\n"
  1936.     "dup 0 ne {2 index add} if \n"
  1937.     "exch\n"
  1938.     "dup 0 ne {3 index add} if \n"
  1939.     "exch\n"
  1940.     "4 2 roll pop pop \n"
  1941.     "advanceMapping transform \n"
  1942.     "6 2 roll \n"
  1943.     "} { \n"
  1944.     "advanceMapping transform \n"
  1945.     "ComputeBBox { \n"
  1946.     "ComputeFaceBBox \n"
  1947.     "} { \n"
  1948.     "/FontBBox load cvx exec \n"
  1949.     "} ifelse\n"
  1950.     "} ifelse\n"
  1951.     "TextFaceSetupFontCache\n"
  1952.     "nLayers 1 sub -1 0 { \n"
  1953.     "faceLayers exch get begin \n"
  1954.     "fillKey /No ne { \n"
  1955.     "newpath \n"
  1956.     "LayerFont setfont \n"
  1957.     "whiteLayer { \n"
  1958.     "CurrCTM currentmatrix \n"
  1959.     "outlineTransform SetTr \n"
  1960.     "0 0 moveto \n"
  1961.     "theChar false GXCharPath    \n"
  1962.     "/In {QD2Clip}    stopped { \n"
  1963.     "newpath \n"
  1964.     "} if\n"
  1965.     "setmatrix \n"
  1966.     "} {\n"
  1967.     "outlineStyle SetStyle \n"
  1968.     "xBold yBold SetBold \n"
  1969.     "gsave\n"
  1970.     "outlineTransform SetTr\n"
  1971.     "SynchPatMatrix \n"
  1972.     "newpath 0 0 moveto \n"
  1973.     "mark \n"
  1974.     "theChar fillKey {QD2Show} stopped    { \n"
  1975.     "counttomark 6 eq{ \n"
  1976.     "5{pop}repeat \n"
  1977.     "dup type /savetype eq{restore}if \n"
  1978.     "}if \n"
  1979.     "} if \n"
  1980.     "cleartomark    \n"
  1981.     "grestore\n"
  1982.     "} ifelse\n"
  1983.     "} if\n"
  1984.     "end \n"
  1985.     "} for\n"
  1986.     "end \n"
  1987.     "end \n"
  1988.     "TextFaceSave restore \n"
  1989.     "} Bdef\n"
  1990.     "/MakeLayerDict {\n"
  1991.     "19 dict begin \n"
  1992.     "/yBold Xdef\n"
  1993.     "/xBold Xdef\n"
  1994.     "/outlineTransform Xdef\n"
  1995.     "/outlineStyle Xdef\n"
  1996.     "/whiteLayer Xdef\n"
  1997.     "/fillKey Xdef\n"
  1998.     "/layerIndex 0 def\n"
  1999.     "/LayerFont null def \n"
  2000.     "/LayerBBoxGrowX 0 def \n"
  2001.     "/LayerBBoxGrowY 0 def \n"
  2002.     "/X1 0 def /Y1 0 def /X2 0 def /Y2 0 def \n"
  2003.     "/X3 0 def /Y3 0 def /X4 0 def /Y4 0 def\n"
  2004.     "/LayerPen 0 def \n"
  2005.     "currentdict \n"
  2006.     "end\n"
  2007.     "} Bdef\n"
  2008.     "/MakeLayeredFontDict {\n"
  2009.     "16 dict begin \n"
  2010.     "/useLW8BuildChar Xdef\n"
  2011.     "/faceLayers Xdef\n"
  2012.     "/advanceMapping Xdef\n"
  2013.     "/autoAdvance Xdef\n"
  2014.     "[ 1 0 0 -1 0 0 ] exch\n"
  2015.     "dup null ne {\n"
  2016.     "aload pop 4 index transform 4 2 roll 4 index transform 4 2 roll 4 array astore /FontBBox Xdef\n"
  2017.     "/ComputeBBox false def\n"
  2018.     "} {\n"
  2019.     "pop\n"
  2020.     "/FontBBox [0 0 0 0] def\n"
  2021.     "/ComputeBBox true def \n"
  2022.     "} ifelse\n"
  2023.     "makefont /baseFont Xdef\n"
  2024.     "/theChar 1 string def \n"
  2025.     "/nLayers faceLayers length def \n"
  2026.     "/CurrCTM matrix def \n"
  2027.     "/HasPattern false def \n"
  2028.     "/FontType 3 def\n"
  2029.     "/FontMatrix matrix def\n"
  2030.     "/Encoding \n"
  2031.     "baseFont /Encoding get\n"
  2032.     "def\n"
  2033.     "nLayers 0 eq { \n"
  2034.     "/BuildChar /AdvanceMappingBuildChar load def \n"
  2035.     "} { \n"
  2036.     "useLW8BuildChar {\n"
  2037.     "/BuildChar /LW8LayerBuildChar load def\n"
  2038.     "} {\n"
  2039.     "/BuildChar /LayerBuildChar load def\n"
  2040.     "} ifelse\n"
  2041.     "baseFont \n"
  2042.     "faceLayers { \n"
  2043.     "exch dup 3 -1 roll \n"
  2044.     "begin \n"
  2045.     "outlineStyle begin \n"
  2046.     "fillKey /Fr eq dash null eq and baseFont /PaintType known and {\n"
  2047.     "pen \n"
  2048.     "1 index exch MakeFramedFont\n"
  2049.     "/FredTheFramedFont exch definefont \n"
  2050.     "exch pop \n"
  2051.     "/fillKey /W store \n"
  2052.     "} if\n"
  2053.     "textSize 1 ne {\n"
  2054.     "textSize scalefont \n"
  2055.     "/LayerFont Xstore \n"
  2056.     "} {\n"
  2057.     "/LayerFont Xstore \n"
  2058.     "} ifelse\n"
  2059.     "pattern null ne {/HasPattern true store} if \n"
  2060.     "fillKey /In eq {/ComputeBBox true store} if \n"
  2061.     "end\n"
  2062.     "end\n"
  2063.     "} forall\n"
  2064.     "pop \n"
  2065.     "} ifelse\n"
  2066.     "currentdict \n"
  2067.     "end\n"
  2068.     "} Bdef\n"
  2069.     "/cUseLW8BuildChar false def\n"
  2070.     "/cFaceLayers null def\n"
  2071.     "/cAdvanceMapping null def\n"
  2072.     "/cAutoAdvance null def\n"
  2073.     "/cfaceBBox null def\n"
  2074.     "/MakeLayeredCompositeFont {\n"
  2075.     "dup /FontType get 0 eq { \n"
  2076.     "0 MakeFontClone dup begin \n"
  2077.     "FDepVector { \n"
  2078.     "MakeLayeredCompositeFont \n"
  2079.     "/FDepLayeredFont exch definefont    \n"
  2080.     "} forall\n"
  2081.     "FDepVector length array astore \n"
  2082.     "/FDepVector exch def\n"
  2083.     "end\n"
  2084.     "} { \n"
  2085.     "cfaceBBox\n"
  2086.     "cAutoAdvance\n"
  2087.     "cAdvanceMapping\n"
  2088.     "[ \n"
  2089.     "cFaceLayers {\n"
  2090.     "begin\n"
  2091.     "fillKey whiteLayer outlineStyle outlineTransform xBold yBold\n"
  2092.     "end\n"
  2093.     "MakeLayerDict \n"
  2094.     "} forall\n"
  2095.     "]\n"
  2096.     "cUseLW8BuildChar\n"
  2097.     "MakeLayeredFontDict\n"
  2098.     "} ifelse\n"
  2099.     "} Bdef\n"
  2100.     "/MakeLayeredFont {\n"
  2101.     "6 index FontDirectory exch known {    \n"
  2102.     "pop pop pop pop pop pop \n"
  2103.     "findfont \n"
  2104.     "exch pop \n"
  2105.     "} { \n"
  2106.     "7 index FontDirectory exch known {    \n"
  2107.     "pop pop pop pop pop \n"
  2108.     "/Encoding get \n"
  2109.     "2 index findfont \n"
  2110.     "[1 0 0 -1 0 0] makefont \n"
  2111.     "0 MakeFontClone \n"
  2112.     "dup 3 -1 roll \n"
  2113.     "/Encoding exch put \n"
  2114.     "} {\n"
  2115.     "5 index /FontType get 0 ne { \n"
  2116.     "MakeLayeredFontDict\n"
  2117.     "} { \n"
  2118.     "/cUseLW8BuildChar Xdef\n"
  2119.     "/cFaceLayers Xdef\n"
  2120.     "/cAdvanceMapping Xdef\n"
  2121.     "/cAutoAdvance Xdef\n"
  2122.     "/cfaceBBox Xdef\n"
  2123.     "MakeLayeredCompositeFont \n"
  2124.     "} ifelse\n"
  2125.     "} ifelse\n"
  2126.     "exch dup /DontCache eq {    \n"
  2127.     "pop /LayeredFont\n"
  2128.     "} if\n"
  2129.     "exch \n"
  2130.     "definefont \n"
  2131.     "exch pop \n"
  2132.     "} ifelse\n"
  2133.     "} Bdef\n"
  2134.     "/MakeSimpleLayeredFont {\n"
  2135.     "[1 0 0 -1 0 0] exch ScratchMatrix concatmatrix \n"
  2136.     "makefont \n"
  2137.     "} Bdef\n"
  2138. };
  2139. resource 'wstr' (kStartProcId+8, sysHeap, purgeable) {
  2140.     "/dispDotDict 12 dict dup begin \n"
  2141.     "/dx [0 1 1 0] def\n"
  2142.     "/dy [0 1 0 1] def\n"
  2143.     "/size 0 def\n"
  2144.     "/nShades 0 def\n"
  2145.     "/theMatrix null def\n"
  2146.     "/lv 0 def\n"
  2147.     "/ilv 0 def\n"
  2148.     "/quadSize 0 def\n"
  2149.     "/quadrant 0 def\n"
  2150.     "/place 0 def\n"
  2151.     "/x 0 def\n"
  2152.     "/y 0 def\n"
  2153.     "end def\n"
  2154.     "/MakeDispDotMatrix {\n"
  2155.     "dispDotDict begin\n"
  2156.     "/dx [0 1 1 0] def \n"
  2157.     "/dy [0 1 0 1] def\n"
  2158.     "/size exch def \n"
  2159.     "/nShades size size mul def \n"
  2160.     "/theMatrix nShades array def \n"
  2161.     "0 1 nShades 1 sub { \n"
  2162.     "/lv exch def \n"
  2163.     "/ilv lv def \n"
  2164.     "/place nShades 4 idiv    def \n"
  2165.     "/quadSize 1 def \n"
  2166.     "/x 0 def /y 0 def \n"
  2167.     "{\n"
  2168.     "place 0 eq {exit} if \n"
  2169.     "/quadrant ilv place idiv def \n"
  2170.     "/ilv ilv quadrant place mul sub def \n"
  2171.     "/x x dx quadrant get quadSize mul add def    \n"
  2172.     "/y y dy quadrant get quadSize mul add def    \n"
  2173.     "/place place 4 idiv def \n"
  2174.     "/quadSize quadSize 2 mul def \n"
  2175.     "} loop\n"
  2176.     "theMatrix \n"
  2177.     "y size mul x add \n"
  2178.     "lv put\n"
  2179.     "} for\n"
  2180.     "end\n"
  2181.     "} Bdef\n"
  2182.     "/FrequencyToMatrixSize {\n"
  2183.     "1 1 matrix defaultmatrix dtransform pop 72 mul abs \n"
  2184.     "exch div \n"
  2185.     "0 5 { \n"
  2186.     "dup 2 exch exp \n"
  2187.     "2 index \n"
  2188.     "gt { \n"
  2189.     "exit \n"
  2190.     "} if\n"
  2191.     "1 add \n"
  2192.     "} repeat\n"
  2193.     "1 sub\n"
  2194.     "exch pop \n"
  2195.     "2 exch exp cvi\n"
  2196.     "} Bdef\n"
  2197.     "/HalftoneDotFunctions 8 dict dup 3 -1 roll Xdef begin\n"
  2198.     "/TriangleDotFunction {\n"
  2199.     "Moby begin \n"
  2200.     "2 div /@2 Xdef \n"
  2201.     "dup 0 lt {neg} if 2 div /@1 Xdef \n"
  2202.     "2 @2 sub 2 @1 mul sub\n"
  2203.     "2.5 div \n"
  2204.     "end\n"
  2205.     "} Bdef\n"
  2206.     "/SpiralDotFunction {\n"
  2207.     "Moby begin \n"
  2208.     "2 div /@2 Xdef \n"
  2209.     "2 div /@1 Xdef \n"
  2210.     "1 @1 dup mul @2 dup mul @1 16 div @2 8 div add add add sub\n"
  2211.     "1.1 div \n"
  2212.     "end\n"
  2213.     "} Bdef\n"
  2214.     "/SquareDotFunction {\n"
  2215.     "Moby begin \n"
  2216.     "/@2 Xdef /@1 Xdef \n"
  2217.     "@1 @2 lt {@2} {@1} ifelse\n"
  2218.     "1 exch sub    \n"
  2219.     "2 div \n"
  2220.     "end\n"
  2221.     "} Bdef\n"
  2222.     "/RoundDotFunction {\n"
  2223.     "Moby begin \n"
  2224.     "abs /@2 Xdef \n"
  2225.     "abs /@1 Xdef \n"
  2226.     "@1 @2 add 1 gt {\n"
  2227.     "/@1 1 @1 sub def \n"
  2228.     "/@2 1 @2 sub def\n"
  2229.     "@1 @1 mul\n"
  2230.     "@2 @2 mul\n"
  2231.     "add\n"
  2232.     "1 sub\n"
  2233.     "} {\n"
  2234.     "1\n"
  2235.     "@1 @1 mul\n"
  2236.     "@2 @2 mul\n"
  2237.     "sub\n"
  2238.     "sub\n"
  2239.     "} ifelse\n"
  2240.     "2 div \n"
  2241.     "end \n"
  2242.     "} Bdef\n"
  2243.     "/EllipticDotFunction {\n"
  2244.     "Moby begin \n"
  2245.     "/@2 Xdef\n"
  2246.     "/@1 Xdef\n"
  2247.     "/@2 @2 2 mul abs def \n"
  2248.     "/@1 @1 @1 mul def \n"
  2249.     "/@1 @1 @2 add def \n"
  2250.     "/@1 @1 3 div def \n"
  2251.     "1 @1 sub\n"
  2252.     "2 div \n"
  2253.     "end\n"
  2254.     "} Bdef\n"
  2255.     "/LineDotFunction {\n"
  2256.     "exch pop    \n"
  2257.     "} Bdef\n"
  2258.     "/DispersedDotFunction {\n"
  2259.     "Moby begin \n"
  2260.     "dispDotDict begin\n"
  2261.     "1 add 2 div size mul cvi exch \n"
  2262.     "1 add 2 div size mul cvi exch \n"
  2263.     "size mul add \n"
  2264.     "theMatrix exch get    \n"
  2265.     "nShades div \n"
  2266.     "end\n"
  2267.     "end\n"
  2268.     "} Bdef\n"
  2269.     "end \n"
  2270.     "/SetHalftoneParams {\n"
  2271.     "1 eq {\n"
  2272.     "dup /DispersedDotFunction eq {\n"
  2273.     "2 index \n"
  2274.     "FrequencyToMatrixSize \n"
  2275.     "MakeDispDotMatrix \n"
  2276.     "} if\n"
  2277.     "HalftoneDotFunctions exch get setscreen\n"
  2278.     "} { \n"
  2279.     "4 {\n"
  2280.     "dup /DispersedDotFunction eq {\n"
  2281.     "2 index \n"
  2282.     "FrequencyToMatrixSize \n"
  2283.     "MakeDispDotMatrix \n"
  2284.     "} if\n"
  2285.     "HalftoneDotFunctions exch get\n"
  2286.     "12 3 roll\n"
  2287.     "} repeat\n"
  2288.     "systemdict /setcolorscreen known {setcolorscreen} {setscreen 9 {pop} repeat} ifelse\n"
  2289.     "} ifelse\n"
  2290.     "} Bdef\n"
  2291.     "languagelevel 2 lt { \n"
  2292.     "/DefineDefaultHalftone {\n"
  2293.     "/DefaultHalftone [ \n"
  2294.     "systemdict /setcolorscreen known\n"
  2295.     "{currentcolorscreen} \n"
  2296.     "{currentscreen} \n"
  2297.     "ifelse\n"
  2298.     "] def\n"
  2299.     "} Bdef\n"
  2300.     "systemdict /setcolorscreen known {\n"
  2301.     "/SetDefaultHalftone {\n"
  2302.     "DefaultHalftone {} forall setcolorscreen\n"
  2303.     "} Bdef\n"
  2304.     "} {\n"
  2305.     "/SetDefaultHalftone {\n"
  2306.     "DefaultHalftone {} forall setscreen\n"
  2307.     "} Bdef\n"
  2308.     "} ifelse\n"
  2309.     "} { \n"
  2310.     "/DefineDefaultHalftone {/DefaultHalftone currenthalftone def} Bdef\n"
  2311.     "/SetDefaultHalftone {DefaultHalftone sethalftone} Bdef\n"
  2312.     "} ifelse\n"
  2313. };
  2314. resource 'wstr' (kPortableColorProcID, sysHeap, purgeable) {
  2315.     "/RGBBufferToGray where {pop true} {false} ifelse\n"
  2316.     "/colorimage where {pop true} {false} ifelse\n"
  2317.     "or\n"
  2318.     "/RGBPatch exch def\n"
  2319.     "RGBPatch {save} if\n"
  2320.     "/fredString null def\n"
  2321.     "/RGBBufferToGray {\n"
  2322.     "/fredString exch store \n"
  2323.     "0 1 fredString length 3 idiv 1 sub {\n"
  2324.     "dup 3 mul dup \n"
  2325.     "fredString exch get \n"
  2326.     "exch \n"
  2327.     "dup 1 add \n"
  2328.     "fredString exch get \n"
  2329.     "exch \n"
  2330.     "2 add \n"
  2331.     "fredString exch get \n"
  2332.     "2 mul exch 9 mul add exch 5 mul add -4 bitshift\n"
  2333.     "fredString\n"
  2334.     "3 1 roll \n"
  2335.     "put\n"
  2336.     "} for\n"
  2337.     "fredString 0 fredString length 3 idiv getinterval\n"
  2338.     "} Bdef\n"
  2339.     "RGBPatch {restore} {(Using PS version of RGBToGray) ==} ifelse\n"
  2340.     "/GetGrayFromRGBBuffer {\n"
  2341.     "dup length 3 idiv 0 exch getinterval\n"
  2342.     "} Bdef\n"
  2343.     "/RGBBufferToGray where {pop false} {true} ifelse /RGBPatch exch def\n"
  2344.     "RGBPatch {save} if\n"
  2345.     "/RGBImage {\n"
  2346.     "[ exch null null null ] \n"
  2347.     "dup 1 /exec load put \n"
  2348.     "currentdict /HaveDrawnIt known {    \n"
  2349.     "HaveDrawnIt \n"
  2350.     "} {\n"
  2351.     "false \n"
  2352.     "}ifelse\n"
  2353.     "{ \n"
  2354.     "dup 2 /GetGrayFromRGBBuffer load put \n"
  2355.     "} { \n"
  2356.     "dup 2 /RGBBufferToGray load put \n"
  2357.     "} ifelse\n"
  2358.     "dup 3 /exec load put \n"
  2359.     "cvx image\n"
  2360.     "currentdict /HaveDrawnIt known { \n"
  2361.     "/HaveDrawnIt true def \n"
  2362.     "} if\n"
  2363.     "} Bdef\n"
  2364.     "/GXColorImage {\n"
  2365.     "3 ne or {\n"
  2366.     "(GXColorImage using RGBToGray, parameter error) ==\n"
  2367.     "errordict /rangecheck get exec\n"
  2368.     "} if\n"
  2369.     "2 index 8 ne { \n"
  2370.     "(GXColorImage using RGBtoGray, must be 8 bits per sample) ==\n"
  2371.     "errordict /rangecheck get exec\n"
  2372.     "}if\n"
  2373.     "RGBImage \n"
  2374.     "} Bdef\n"
  2375.     "RGBPatch {restore} if\n"
  2376.     "languagelevel 2 lt {save} if\n"
  2377.     "/GXPortableColorSpace [/DeviceRGB] def\n"
  2378.     "/SetPortableColorSpace {\n"
  2379.     "dup setcolorspace /GXPortableColorSpace Xdef \n"
  2380.     "} Bdef\n"
  2381.     "/GXSetRGBColor {\n"
  2382.     "currentcolorspace GXPortableColorSpace ne {\n"
  2383.     "GXPortableColorSpace setcolorspace\n"
  2384.     "} if\n"
  2385.     "setcolor    \n"
  2386.     "} Bdef\n"
  2387.     "/GXColorImage {\n"
  2388.     "dup 4 eq { \n"
  2389.     "colorimage \n"
  2390.     "} { \n"
  2391.     "currentcolorspace GXPortableColorSpace ne {\n"
  2392.     "GXPortableColorSpace setcolorspace\n"
  2393.     "} if\n"
  2394.     "7 dict begin\n"
  2395.     "3 ne {(GXColorImage must be 3 components) == errordict /rangecheck get exec} if \n"
  2396.     "dup /MultipleDataSources Xdef { \n"
  2397.     "3 array astore \n"
  2398.     "} if\n"
  2399.     "/DataSource Xdef \n"
  2400.     "/ImageMatrix Xdef \n"
  2401.     "/BitsPerComponent Xdef \n"
  2402.     "/Height Xdef /Width Xdef \n"
  2403.     "/ImageType 1 def\n"
  2404.     "/Decode [0 1 0 1 0 1] def \n"
  2405.     "currentdict \n"
  2406.     "end\n"
  2407.     "image \n"
  2408.     "} ifelse\n"
  2409.     "} Bdef \n"
  2410.     "languagelevel 2 lt {restore} if\n"
  2411.     "languagelevel 1 gt {save} if\n"
  2412.     "/MakeResponseFunction {\n"
  2413.     "pop \n"
  2414.     "[] cvx \n"
  2415.     "} Bdef\n"
  2416.     "/MakeCalibratedRGBSpace {\n"
  2417.     "18 {pop} repeat \n"
  2418.     "[] \n"
  2419.     "} Bdef\n"
  2420.     "/SetPortableColorSpace { pop } Bdef \n"
  2421.     "languagelevel 1 gt {restore} if\n"
  2422.     "systemdict /currentcolortransfer known {save} if    \n"
  2423.     "/PortablizeColorSetParams {\n"
  2424.     "dup 1 gt { \n"
  2425.     "dup 3 eq { \n"
  2426.     "5 -3 roll \n"
  2427.     "0 1 2 index length 1 sub \n"
  2428.     "{\n"
  2429.     "dup 4 index exch get exch \n"
  2430.     "dup 4 index exch get exch \n"
  2431.     "dup 4 index exch get exch \n"
  2432.     "4 1 roll \n"
  2433.     ".11 mul 3 1 roll\n"
  2434.     ".59 mul 3 1 roll\n"
  2435.     ".30 mul 3 1 roll \n"
  2436.     "add add \n"
  2437.     "4 index 3 1 roll \n"
  2438.     "put \n"
  2439.     "} for\n"
  2440.     "pop pop \n"
  2441.     "3 1 roll \n"
  2442.     "pop 1 \n"
  2443.     "} { \n"
  2444.     "(Can't use CMYK and Portable PostScript) ==\n"
  2445.     "} ifelse \n"
  2446.     "} if\n"
  2447.     "} Bdef\n"
  2448.     "systemdict /currentcolortransfer known {restore} if\n"
  2449. };
  2450. resource 'wstr' (kLevel2ColorProcID, sysHeap, purgeable) {
  2451.     "languagelevel 2 lt {save} if\n"
  2452.     "/ResponseFunction {\n"
  2453.     "dup length 1 sub \n"
  2454.     "3 -1 roll \n"
  2455.     "1 index mul    dup floor \n"
  2456.     "dup 3 index ge { \n"
  2457.     "pop pop get\n"
  2458.     "} { \n"
  2459.     "dup 0.0 le { \n"
  2460.     "pop pop pop 0 get \n"
  2461.     "} { \n"
  2462.     "cvi \n"
  2463.     "dup 4 index exch get \n"
  2464.     "4 index \n"
  2465.     "2 index \n"
  2466.     "1 add get \n"
  2467.     "1 index sub \n"
  2468.     "4 -2 roll \n"
  2469.     "sub \n"
  2470.     "mul add \n"
  2471.     "3 1 roll pop pop \n"
  2472.     "} ifelse\n"
  2473.     "} ifelse\n"
  2474.     "} Bdef\n"
  2475.     "/MakeResponseFunction {\n"
  2476.     "[ \n"
  2477.     "exch \n"
  2478.     "/ResponseFunction \n"
  2479.     "load /exec load \n"
  2480.     "] cvx \n"
  2481.     "} Bdef\n"
  2482.     "/MakeXYZSpace {\n"
  2483.     "5 dict begin \n"
  2484.     "/BlackPoint [ \n"
  2485.     "5 -3 roll\n"
  2486.     "] def\n"
  2487.     "/WhitePoint [ \n"
  2488.     "5 -3 roll\n"
  2489.     "] def\n"
  2490.     "/RangeABC [ \n"
  2491.     "0 2.0\n"
  2492.     "0 2.0\n"
  2493.     "0 2.0\n"
  2494.     "] def\n"
  2495.     "/RangeLMN [\n"
  2496.     "0 2.0\n"
  2497.     "0 2.0\n"
  2498.     "0 2.0\n"
  2499.     "] def    \n"
  2500.     "[/CIEBasedABC currentdict] \n"
  2501.     "end\n"
  2502.     "} Bdef\n"
  2503.     "version cvr 2012.016 ge {save} if \n"
  2504.     "/AdjustBlueForWhitePoint {\n"
  2505.     "WhitePoint 0 get \n"
  2506.     "MatrixLMN 0 get \n"
  2507.     "MatrixLMN 3 get \n"
  2508.     "MatrixLMN 6 get \n"
  2509.     "add add \n"
  2510.     "sub \n"
  2511.     "MatrixLMN 6 get \n"
  2512.     "add \n"
  2513.     "MatrixLMN 6 3 -1 roll put \n"
  2514.     "WhitePoint 1 get \n"
  2515.     "MatrixLMN 1 get \n"
  2516.     "MatrixLMN 4 get \n"
  2517.     "MatrixLMN 7 get \n"
  2518.     "add add \n"
  2519.     "sub \n"
  2520.     "MatrixLMN 7 get \n"
  2521.     "add \n"
  2522.     "MatrixLMN 7 3 -1 roll put \n"
  2523.     "WhitePoint 2 get \n"
  2524.     "MatrixLMN 2 get \n"
  2525.     "MatrixLMN 5 get \n"
  2526.     "MatrixLMN 8 get \n"
  2527.     "add add \n"
  2528.     "sub \n"
  2529.     "MatrixLMN 8 get \n"
  2530.     "add \n"
  2531.     "MatrixLMN 8 3 -1 roll put \n"
  2532.     "} Bdef\n"
  2533.     "version cvr 2012.016 ge {restore} if\n"
  2534.     "version cvr 2012.016 lt {save} if\n"
  2535.     "/AdjustBlueForWhitePoint { } def\n"
  2536.     "version cvr 2012.016 lt {restore} if\n"
  2537.     "/MakeCalibratedRGBSpace {\n"
  2538.     "5 dict begin \n"
  2539.     "/RangeABC [0 1.0 0 1.0 0 1.0] def \n"
  2540.     "/BlackPoint [ \n"
  2541.     "5 -3 roll\n"
  2542.     "] def\n"
  2543.     "/WhitePoint [ \n"
  2544.     "5 -3 roll\n"
  2545.     "] def\n"
  2546.     "/RangeLMN [0 1.0 0 1.0 0 1.0]    def\n"
  2547.     "/MatrixLMN [\n"
  2548.     "11 -9 roll\n"
  2549.     "] def\n"
  2550.     "/DecodeABC [\n"
  2551.     "5 -3 roll \n"
  2552.     "] def \n"
  2553.     "AdjustBlueForWhitePoint \n"
  2554.     "[/CIEBasedABC currentdict] \n"
  2555.     "end\n"
  2556.     "} Bdef\n"
  2557.     "/resourcestatus where {pop} {\n"
  2558.     "/resourcestatus {pop pop false} bind def\n"
  2559.     "/defineresource {pop pop pop null} bind def\n"
  2560.     "} ifelse\n"
  2561.     "/ColorRendering /ProcSet resourcestatus { \n"
  2562.     "pop pop \n"
  2563.     "save true \n"
  2564.     "} { \n"
  2565.     "false \n"
  2566.     "}ifelse\n"
  2567.     "3 dict begin \n"
  2568.     "/GetSubstituteCRD {\n"
  2569.     "dup length 1 add string exch 1 index cvs pop \n"
  2570.     "dup dup length 1 sub (*) putinterval \n"
  2571.     "mark exch {exit} 128 string /ColorRendering resourceforall \n"
  2572.     "counttomark 1 eq { \n"
  2573.     "cvn exch pop \n"
  2574.     "} { \n"
  2575.     "pop \n"
  2576.     "/DefaultColorRendering    \n"
  2577.     "} ifelse\n"
  2578.     "} bind def\n"
  2579.     "/GetHalftoneName {\n"
  2580.     "currenthalftone dup /HalftoneName known { \n"
  2581.     "/HalftoneName get \n"
  2582.     "} { \n"
  2583.     "pop /none \n"
  2584.     "} ifelse\n"
  2585.     "} bind def\n"
  2586.     "/GetPageDeviceName {\n"
  2587.     "currentpagedevice dup /PageDeviceName known { \n"
  2588.     "/PageDeviceName get \n"
  2589.     "dup //null eq { \n"
  2590.     "pop /none \n"
  2591.     "} if\n"
  2592.     "} { \n"
  2593.     "pop /none \n"
  2594.     "} ifelse\n"
  2595.     "} bind def\n"
  2596.     "currentdict end \n"
  2597.     "/ColorRendering exch /ProcSet defineresource pop \n"
  2598.     "{restore} if\n"
  2599.     "/findcolorrendering where {pop save true} \n"
  2600.     "{false} ifelse \n"
  2601.     "/findcolorrendering {\n"
  2602.     "/ColorRendering /ProcSet findresource \n"
  2603.     "begin \n"
  2604.     "dup \n"
  2605.     "dup length \n"
  2606.     "GetPageDeviceName dup    length \n"
  2607.     "3 -1 roll \n"
  2608.     "GetHalftoneName dup length \n"
  2609.     "exch 4 1 roll \n"
  2610.     "add add 2 add string \n"
  2611.     "dup 4 index exch cvs pop \n"
  2612.     "dup 4 index length (.) putinterval \n"
  2613.     "dup 4 index length 1 add 4 index \n"
  2614.     "dup length string cvs putinterval \n"
  2615.     "dup length 2 index length 1 add sub \n"
  2616.     "exch dup 2 index (.) putinterval \n"
  2617.     "dup\n"
  2618.     "3 -1 roll 1 add \n"
  2619.     "3 index dup length string cvs \n"
  2620.     "putinterval\n"
  2621.     "4 1 roll pop pop pop \n"
  2622.     "cvn \n"
  2623.     "dup /ColorRendering resourcestatus { \n"
  2624.     "pop pop \n"
  2625.     "exch pop \n"
  2626.     "true \n"
  2627.     "} { \n"
  2628.     "pop \n"
  2629.     "GetSubstituteCRD \n"
  2630.     "false \n"
  2631.     "} ifelse\n"
  2632.     "end \n"
  2633.     "} bind def\n"
  2634.     "{restore} if \n"
  2635.     "/GXFindCRDName {\n"
  2636.     "dup length\n"
  2637.     "9 add string \n"
  2638.     "dup 2 index exch cvs length \n"
  2639.     "1 index \n"
  2640.     "exch (.mac.none) putinterval \n"
  2641.     "cvn \n"
  2642.     "dup /ColorRendering resourcestatus { \n"
  2643.     "pop pop \n"
  2644.     "exch pop \n"
  2645.     "true \n"
  2646.     "} { \n"
  2647.     "pop \n"
  2648.     "findcolorrendering \n"
  2649.     "} ifelse\n"
  2650.     "} Bdef\n"
  2651.     "/MakeCSDict {\n"
  2652.     "2 dict begin\n"
  2653.     "dup type /nametype eq { \n"
  2654.     "GXFindCRDName \n"
  2655.     "1 index /DefaultColorRendering ne or { \n"
  2656.     "/ColorRendering findresource \n"
  2657.     "} { \n"
  2658.     "pop currentcolorrendering \n"
  2659.     "} ifelse\n"
  2660.     "/CRD exch def \n"
  2661.     "} if\n"
  2662.     "/CSA exch def \n"
  2663.     "currentdict end\n"
  2664.     "} Bdef\n"
  2665.     "/GXSetCRD {\n"
  2666.     "dup /CRD known { \n"
  2667.     "/CRD get dup currentcolorrendering ne { \n"
  2668.     "setcolorrendering \n"
  2669.     "} { \n"
  2670.     "pop \n"
  2671.     "} ifelse\n"
  2672.     "} { \n"
  2673.     "pop \n"
  2674.     "} ifelse\n"
  2675.     "} Bdef\n"
  2676.     "/GXSetCSA {\n"
  2677.     "/CSA get dup currentcolorspace ne { \n"
  2678.     "setcolorspace \n"
  2679.     "} { \n"
  2680.     "pop \n"
  2681.     "} ifelse\n"
  2682.     "} Bdef\n"
  2683.     "/GXSetCSpace {\n"
  2684.     "dup \n"
  2685.     "GXSetCRD \n"
  2686.     "GXSetCSA \n"
  2687.     "} Bdef\n"
  2688.     "languagelevel 2 lt {restore} if\n"
  2689. };
  2690. resource 'wstr' (kFHStartProcId, sysHeap, purgeable) {
  2691.     "/FHSaveLevel null def\n"
  2692.     "/DoSave {\n"
  2693.     "/FHSaveLevel save def\n"
  2694.     "} bind def\n"
  2695.     "/DoRestore {\n"
  2696.     "/currentpoint \n"
  2697.     "load stopped not \n"
  2698.     "dup { \n"
  2699.     "3 1 roll \n"
  2700.     "transform \n"
  2701.     "3 -1 roll \n"
  2702.     "} if\n"
  2703.     "FHSaveLevel restore \n"
  2704.     "{ \n"
  2705.     "itransform \n"
  2706.     "moveto \n"
  2707.     "} if\n"
  2708.     "} bind def\n"
  2709.     "/HexDigitToInt {\n"
  2710.     "dup 57 le { \n"
  2711.     "48 sub \n"
  2712.     "} { \n"
  2713.     "dup 70 le { \n"
  2714.     "55 sub                                    \n"
  2715.     "} { \n"
  2716.     "87 sub \n"
  2717.     "} ifelse\n"
  2718.     "} ifelse\n"
  2719.     "} bind def\n"
  2720.     "/HexNameToBytes {\n"
  2721.     "nameString cvs \n"
  2722.     "/nameLength exch length 1 sub def \n"
  2723.     "nameString 1 nameLength getinterval    \n"
  2724.     "/tempString exch def \n"
  2725.     "0 1 nameLength 1 sub { \n"
  2726.     "tempString exch get \n"
  2727.     "HexDigitToInt \n"
  2728.     "} for\n"
  2729.     "nameLength 2 idiv 1 sub -1 0 { \n"
  2730.     "3 1 roll \n"
  2731.     "exch 16 mul add \n"
  2732.     "tempString 3 1 roll\n"
  2733.     "put \n"
  2734.     "} for\n"
  2735.     "tempString 0 nameLength 2 idiv getinterval\n"
  2736.     "} bind def\n"
  2737.     "/ReEncodedCompositeBuildChar {\n"
  2738.     "GXFontDict begin \n"
  2739.     "exch begin\n"
  2740.     "LocalVariables begin\n"
  2741.     "Encoding exch get \n"
  2742.     "baseFontDict setfont \n"
  2743.     "HexNameToBytes \n"
  2744.     "dup stringwidth \n"
  2745.     "setcharwidth \n"
  2746.     "0 0 moveto show \n"
  2747.     "end\n"
  2748.     "end\n"
  2749.     "end\n"
  2750.     "} bind def\n"
  2751.     "/ReEncodeCompositeFont {\n"
  2752.     "10 dict begin\n"
  2753.     "1 scalefont /baseFontDict exch def \n"
  2754.     "/Encoding exch def \n"
  2755.     "pop \n"
  2756.     "/FontMatrix matrix def\n"
  2757.     "/FontBBox [0 0 0 0] def\n"
  2758.     "/FontType 3 def\n"
  2759.     "/BuildChar /ReEncodedCompositeBuildChar load def\n"
  2760.     "/LocalVariables 3 dict dup begin\n"
  2761.     "/nameString 5 string def \n"
  2762.     "/nameLength 0 def \n"
  2763.     "/tempString 4 string def \n"
  2764.     "end def\n"
  2765.     "currentdict \n"
  2766.     "end\n"
  2767.     "definefont pop \n"
  2768.     "} bind def\n"
  2769.     "/AccentNames [\n"
  2770.     "(acute)\n"
  2771.     "(grave)\n"
  2772.     "(circumflex)\n"
  2773.     "(cedilla)\n"
  2774.     "(ring)\n"
  2775.     "(tilde)\n"
  2776.     "(dieresis)\n"
  2777.     "(caron)\n"
  2778.     "] def\n"
  2779.     "/GlyphNameString 255 string def\n"
  2780.     "/EncodingIndex 0 def\n"
  2781.     "/FreeEncodingIndex 0 def\n"
  2782.     "/FoundName false def\n"
  2783.     "/AddToEncoding {\n"
  2784.     "/EncodingIndex 0 store \n"
  2785.     "/FoundName false store \n"
  2786.     "/FreeEncodingIndex -1 store \n"
  2787.     "Encoding {\n"
  2788.     "dup /.notdef eq { \n"
  2789.     "EncodingIndex 0 ne { \n"
  2790.     "/FreeEncodingIndex \n"
  2791.     "EncodingIndex store\n"
  2792.     "} if\n"
  2793.     "pop \n"
  2794.     "} { \n"
  2795.     "1 index eq { \n"
  2796.     "/FoundName true store    \n"
  2797.     "exit \n"
  2798.     "} if\n"
  2799.     "} ifelse\n"
  2800.     "/EncodingIndex EncodingIndex 1 add store \n"
  2801.     "} forall\n"
  2802.     "FoundName not { \n"
  2803.     "FreeEncodingIndex -1 ne { \n"
  2804.     "Encoding exch FreeEncodingIndex exch put \n"
  2805.     "} { \n"
  2806.     "(Couldn't find empty spot in encoding) == \n"
  2807.     "} ifelse\n"
  2808.     "} { \n"
  2809.     "pop \n"
  2810.     "} ifelse\n"
  2811.     "} bind def\n"
  2812.     "/EncodeAccentedCharacter {\n"
  2813.     "GlyphNameString cvs \n"
  2814.     "AccentNames { \n"
  2815.     "1 index exch \n"
  2816.     "search { \n"
  2817.     "3 -1 roll \n"
  2818.     "length 0 eq { \n"
  2819.     "cvn exch cvn    \n"
  2820.     "AddToEncoding    \n"
  2821.     "AddToEncoding    \n"
  2822.     "exit \n"
  2823.     "} { \n"
  2824.     "pop pop \n"
  2825.     "} ifelse\n"
  2826.     "} { \n"
  2827.     "pop \n"
  2828.     "} ifelse\n"
  2829.     "} forall\n"
  2830.     "pop \n"
  2831.     "} bind def\n"
  2832.     "/FixSEAC {\n"
  2833.     "dup begin \n"
  2834.     "Encoding { \n"
  2835.     "EncodeAccentedCharacter \n"
  2836.     "} forall\n"
  2837.     "end\n"
  2838.     "} bind def\n"
  2839.     "/ReEncodeNormalFont {\n"
  2840.     "dup length \n"
  2841.     "dict \n"
  2842.     "exch \n"
  2843.     "{\n"
  2844.     "exch dup /FID ne \n"
  2845.     "{    \n"
  2846.     "2 index \n"
  2847.     "4 1 roll \n"
  2848.     "exch\n"
  2849.     "put \n"
  2850.     "}\n"
  2851.     "{pop pop} \n"
  2852.     "ifelse\n"
  2853.     "} forall\n"
  2854.     "dup \n"
  2855.     "3 -1 roll \n"
  2856.     "/Encoding exch    \n"
  2857.     "put \n"
  2858.     "exch { \n"
  2859.     "dup /FontType get 4 eq \n"
  2860.     "version    cvr 49.0 le \n"
  2861.     "or { \n"
  2862.     "FixSEAC \n"
  2863.     "} if\n"
  2864.     "} if\n"
  2865.     "definefont pop\n"
  2866.     "} bind def\n"
  2867.     "/ReEncodeFont {\n"
  2868.     "findfont dup /FontType get 0 eq {\n"
  2869.     "ReEncodeCompositeFont    \n"
  2870.     "} {\n"
  2871.     "ReEncodeNormalFont    \n"
  2872.     "} ifelse\n"
  2873.     "} bind def\n"
  2874.     "/MakeCompositeFont {\n"
  2875.     "6 dict begin \n"
  2876.     "/FontName exch def \n"
  2877.     "dup length /numFonts exch def \n"
  2878.     "/FontType 0 def \n"
  2879.     "/FMapType 2 def \n"
  2880.     "/FDepVector exch def \n"
  2881.     "/FontMatrix matrix def \n"
  2882.     "/Encoding numFonts array def\n"
  2883.     "0 1 numFonts 1 sub {\n"
  2884.     "Encoding exch dup \n"
  2885.     "put \n"
  2886.     "} for\n"
  2887.     "FontName currentdict definefont pop\n"
  2888.     "end\n"
  2889.     "} bind def\n"
  2890. };
  2891.